Using the API
API overview
Every endpoint, what it does, and whether it needs a key.
Base URL
https://api.xkiro.com
Content type
application/json
Auth
Bearer token or x-api-key
Endpoints#
| Field | Type | Description |
|---|---|---|
POST /v1/chat/completions | key required | OpenAI-compatible text generation, with streaming, tools, vision and reasoning. See Chat Completions. |
POST /v1/messages | key required | Anthropic-compatible text generation, including extended thinking. See Messages. |
POST /v1/messages/count_tokens | key required | Estimate the input size of a request before sending it. See Count tokens. |
GET /v1/models | public | The CHAT model catalog — speech and image models are not listed. See List models. |
| Field | Type | Description |
|---|---|---|
POST /v1/audio/speech | key required | Turn text into audio; the response body is raw audio bytes. See Text to speech. |
GET /v1/audio/voices | public | The voice catalog, filterable by language. See List voices. |
| Field | Type | Description |
|---|---|---|
POST /v1/images/generations | key required | Submit a generation job; returns a job ID to poll. See Generate images. |
POST /v1/images/edits | key required | Upload an image and describe a change. Multipart. See Edit images. |
GET /v1/images/generations/{id} | key required | Poll a job for its result. See Retrieve a job. |
GET /v1/images/generations | key required | List your recent jobs, newest first, with cursor pagination. |
| Field | Type | Description |
|---|---|---|
GET /v1/usage | key required | Spend windows, today's free token allowance and wallet balance — the same counters that decide whether a request is accepted. Free to call. See Usage & limits. |
Conventions#
Authentication
Send either Authorization: Bearer <key> or x-api-key: <key>. They are equivalent; use whichever your SDK sends. See Authentication.
Model IDs
Always vendor/model, for example openai/gpt-5.6-sol. The bare model name returns 404.
Errors
The error shape follows the dialect you called: OpenAI style on /v1/chat/completions and the other JSON routes, Anthropic style on /v1/messages. Full list on Error codes.
Timeouts
Blocking requests are cut off at 95 seconds
Anything longer must stream. Reasoning models on large prompts routinely exceed this — see Streaming.
Versioning#
The /v1 prefix is the API version. Additive changes — new fields, new models, new endpoints — ship without a version bump, so parse responses tolerantly and ignore fields you do not recognise. Anything that would break existing integrations would arrive under a new prefix.
Checking connectivity#
GET /v1/modelsis public and cheap, which makes it the right smoke test for network, DNS and proxy configuration — it separates "cannot reach xKiro" from "credentials are wrong".
curl -sS https://api.xkiro.com/v1/models | head -c 200