API reference
API reference
Overview
The Antarya API is a plain web API. Send JSON to https://antarya.ai/v1 and read JSON back. Every endpoint below uses the same key, the same error shape and the same headers.
| Endpoint | Purpose |
|---|---|
POST /v1/chat |
Reply to a conversation, as one body or as a stream. |
/v1/sessions |
Keep a conversation on Antarya's side and add to it turn by turn. |
POST /v1/chat/completions |
The OpenAI-shaped door, for clients written for OpenAI. |
POST /v1/count-tokens |
Count the input tokens of a chat request. |
/v1/files |
Upload, list, fetch and delete files for use in messages. |
/v1/batches |
Run many chat requests at once and collect the replies later. |
GET /v1/models |
List models and describe one. Paged lists (sessions and files) reply as {object: "list", data, has_more}. The models list is not paged and has no has_more. |
Base URL
https://antarya.ai/v1
Authentication
Send your key in the Authorization header on every request. Keys start with ak-. Make one on the Keys page of the platform, and keep it out of code that runs in a browser.
curl https://antarya.ai/v1/models \
-H "Authorization: Bearer $ANTARYA_API_KEY"{
"data": [
{"id": "antarya"}
]
}Requests and replies
Bodies are JSON, sent with Content-Type: application/json. The one exception is a file upload, which is multipart form data. Replies are JSON, or server-sent events when a chat request sets stream to true.
Request ids
Every reply carries a request-id header. A failed request also returns the same value as request_id in its body. Include it when you write to support, and Antarya can find the request.
Versioning
The version is part of the path. /v1 stays as it is: new fields and new endpoints can appear in it, and nothing in it is removed or renamed. A change that breaks existing requests ships as /v2, and /v1 keeps working alongside it. Write your code to ignore fields it does not know.