CostIQDocs

Start

Make your first request.

Verify your key and the complete public API path before configuring an agent or application. You only need a CostIQ-issued key and cURL.

Before you begin

Ask your CostIQ administrator for a key created specifically for you or the service you are connecting. Do not share a credential across people or environments.

01

Configure your shell

The silent prompt keeps the key out of your terminal history and screen.

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
02

List available models

A healthy, authorized request returns general-fast in the response data.

GET /models
curl "$COSTIQ_BASE_URL/models" \
  -H "Authorization: Bearer $COSTIQ_API_KEY"
03

Create a response

Use the native Responses API for agentic and tool-using clients.

POST /responses
curl "$COSTIQ_BASE_URL/responses" \
  -H "Authorization: Bearer $COSTIQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "general-fast",
    "input": "Explain this in one sentence.",
    "store": false
  }'
04

Stream a response

Set stream to true and consume typed server-sent events untilresponse.completed or an error event.

Streaming cURL
curl -N "$COSTIQ_BASE_URL/responses" \
  -H "Authorization: Bearer $COSTIQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "general-fast",
    "input": "Write a haiku.",
    "store": false,
    "stream": true
  }'
05

Choose a client

If all four checks pass, continue with the verified Codexor OpenCode setup. Python and TypeScript examples are available on the same page. Qualify any other agent against the published compatibility contract before production use.