Quickstart

Create a key, send a request, and stream a response. Around one minute end to end.

1. Create an API key#

Sign in and open the API Keys page. Create a key and copy it — the full value is shown once and stored only as a hash, so it cannot be recovered later.

Keep it out of your source code
export XKIRO_API_KEY="sk-xt-..."

Keep the key on your server

Anything running on a user's device can be read by that user, so call xKiro from your own server and let your app talk to your server. More on rotation and scoping in Authentication.

2. Send your first request#

Every example below is the same request in a different client. Note the base URL: the OpenAI SDKs want /v1 on the end, the Anthropic SDK adds it for you.

curl https://api.xkiro.com/v1/chat/completions \
  -H "Authorization: Bearer $XKIRO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-5.6-sol",
    "messages": [
      { "role": "user", "content": "Explain HTTP caching in two sentences." }
    ]
  }'

What comes back

200 OK
{
  "id": "chatcmpl-9f1c2a4e",
  "object": "chat.completion",
  "created": 1785734400,
  "model": "openai/gpt-5.6-sol",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "HTTP caching stores copies of responses so later requests can be served without contacting the origin server. Headers such as Cache-Control and ETag decide how long a copy stays fresh and how it is revalidated."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 14,
    "completion_tokens": 42,
    "total_tokens": 56
  }
}

3. Stream the response#

Streaming sends tokens as they are produced instead of waiting for the full answer. Use it for anything a person watches — and for long answers, where it also avoids request timeouts.

curl https://api.xkiro.com/v1/chat/completions \
  -H "Authorization: Bearer $XKIRO_API_KEY" \
  -H "Content-Type: application/json" \
  -N \
  -d '{
    "model": "openai/gpt-5.6-sol",
    "stream": true,
    "messages": [{ "role": "user", "content": "Count to five." }]
  }'

Long non-streaming requests are cut off at 95 seconds

A blocking request that runs past that limit returns a timeout error. Reasoning models on large prompts routinely exceed it, so set stream: true for those. See Streaming.

Where to go next#

  • Models — the catalog, model IDs and what each one supports.
  • Tool calling — let the model call your functions.
  • Reasoning — trade latency and cost for depth.
  • Errors — what each status code means and how to react.