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#

Text generation
FieldTypeDescription
POST /v1/chat/completionskey requiredOpenAI-compatible text generation, with streaming, tools, vision and reasoning. See Chat Completions.
POST /v1/messageskey requiredAnthropic-compatible text generation, including extended thinking. See Messages.
POST /v1/messages/count_tokenskey requiredEstimate the input size of a request before sending it. See Count tokens.
GET /v1/modelspublicThe CHAT model catalog — speech and image models are not listed. See List models.
Speech
FieldTypeDescription
POST /v1/audio/speechkey requiredTurn text into audio; the response body is raw audio bytes. See Text to speech.
GET /v1/audio/voicespublicThe voice catalog, filterable by language. See List voices.
Image
FieldTypeDescription
POST /v1/images/generationskey requiredSubmit a generation job; returns a job ID to poll. See Generate images.
POST /v1/images/editskey requiredUpload an image and describe a change. Multipart. See Edit images.
GET /v1/images/generations/{id}key requiredPoll a job for its result. See Retrieve a job.
GET /v1/images/generationskey requiredList your recent jobs, newest first, with cursor pagination.
Account
FieldTypeDescription
GET /v1/usagekey requiredSpend 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