CostIQDocs

Build

Connect the tools you already use.

Start with a production-qualified Codex or OpenCode setup. Other Responses API and Chat Completions clients can connect when they satisfy the published compatibility contract.

Shared configuration

Set the same three environment variables regardless of client.

Shell
export COSTIQ_BASE_URL=https://inference.costiq.xyz/v1
export COSTIQ_MODEL=general-fast
printf 'CostIQ API key: ' >&2
read -r -s COSTIQ_API_KEY && printf '\n' >&2
export COSTIQ_API_KEY

Compatibility status

OpenAI compatibility is not one binary capability. CostIQ qualifies each client and protocol path with a real task.

ClientProtocolStatusEvidence
Codex CLI 0.155.0ResponsesVerifiedFresh profile, authenticated catalog, streaming, shell tool, and file change.
OpenCode 1.18.31ResponsesVerifiedClean project, function tool call, and exact file write.
@ai-sdk/openai 4.0.83Responses and ChatVerified12 Responses calls, 54 streamed multi-tool scenarios, and 10 non-streamed post-tool continuations.
cURL, Python, TypeScriptResponsesVerified examplesModel discovery, non-streaming, streaming, usage, and errors.
Other agentsResponses or ChatQualification requiredMust pass the checklist below; a custom base URL alone is not enough.

Verified versions were exercised through the public CostIQ endpoint, most recently on 4 October 2026. Only the listed versions are qualified; recheck after a client upgrade or protocol or tool-calling change.

CX

Codex

Use CostIQ as a native Responses API provider.

Create a separate user-level profile so CostIQ does not replace your normal Codex provider. Save this file next to ~/.codex/config.toml; do not put provider configuration in a project-level .codex/config.toml.

~/.codex/costiq.config.toml
model = "general-fast"
model_provider = "costiq"
model_context_window = 500000
model_reasoning_effort = "high"

[model_providers.costiq]
name = "CostIQ"
base_url = "https://inference.costiq.xyz/v1"
wire_api = "responses"
request_max_retries = 0
stream_max_retries = 0

[model_providers.costiq.auth]
command = "printenv"
args = ["COSTIQ_API_KEY"]
Start Codex
codex --profile costiq

Export COSTIQ_API_KEY before starting. The credential command reads it without storing the key in TOML and enables Codex to refresh CostIQ's authenticated model catalog. The published command is for macOS and Linux.

OC

OpenCode

Use CostIQ through OpenCode's native Responses provider.

Place this file in the project you intend to use. It reads the key from the process environment and does not require storing the credential in OpenCode's auth file.

opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "costiq": {
      "npm": "@ai-sdk/openai",
      "name": "CostIQ",
      "options": {
        "baseURL": "{env:COSTIQ_BASE_URL}",
        "apiKey": "{env:COSTIQ_API_KEY}"
      },
      "models": {
        "general-fast": { "name": "General Fast" }
      }
    }
  },
  "model": "costiq/general-fast"
}
Verify OpenCode
opencode run --model costiq/general-fast "Reply with exactly OK."
PY

Python

Official OpenAI Python client with a custom base URL.

Install
env -u COSTIQ_API_KEY python3 -m pip install openai
client.py
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["COSTIQ_API_KEY"],
    base_url=os.environ.get(
        "COSTIQ_BASE_URL",
        "https://inference.costiq.xyz/v1",
    ).rstrip("/"),
    max_retries=0,
    timeout=60.0,
)

response = client.responses.create(
    model=os.environ.get("COSTIQ_MODEL", "general-fast"),
    input="Reply with gateway-ok",
    store=False,
)

print(response.output_text)
TS

TypeScript

Official OpenAI JavaScript client with retries disabled.

Install
env -u COSTIQ_API_KEY npm install openai
client.ts
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.COSTIQ_API_KEY,
  baseURL:
    process.env.COSTIQ_BASE_URL ??
    "https://inference.costiq.xyz/v1",
  maxRetries: 0,
  timeout: 60_000,
});

const response = await client.responses.create({
  model: process.env.COSTIQ_MODEL ?? "general-fast",
  input: "Reply with gateway-ok",
  store: false,
});

console.log(response.output_text);

Other clients

An agent is a CostIQ candidate only if it lets you set the complete base URL, bearer key, and model alias, and if it speaks native Responses or Chat Completions. If it hard-codes OpenAI-only account endpoints, hides the base URL, or requires a proprietary subscription transport, it is not automatically compatible.

  1. Set https://inference.costiq.xyz/v1, your CostIQ key, and general-fast. Do not append a second /v1.
  2. Verify authenticated model discovery and one small non-streaming request.
  3. Verify streaming reaches its protocol-specific terminal event.
  4. Run one function-tool round trip and one harmless real task, not only a text reply.
  5. Confirm the client surfaces 401, 403, 413, and 429 without retry storms.