API reference
The API follows the OpenAI format at https://ai.geraikita.com/v1 and the Anthropic format at https://ai.geraikita.com. All request and response bodies are JSON (UTF-8).
| Endpoint | Purpose |
|---|---|
| POST /v1/chat/completions | OpenAI-format chat (stream & non-stream) |
| POST /v1/messages | Anthropic-format messages (stream & non-stream) |
| POST /v1/messages/count_tokens | Count Anthropic-format prompt tokens — free |
| GET /v1/models | List of available models |
| POST /v1/images/generations | Generate images from a text prompt, billed per image — see Image generation |
/v1/responses, /v1/embeddings) are not supported yet.Chat completions (OpenAI)
https://ai.geraikita.com/v1/chat/completionsGenerates a response from a list of messages. Headers: Authorization: Bearer gk-… and Content-Type: application/json.
Request body
| Parameter | Type | Description |
|---|---|---|
model | string | Required. The model id exactly as in the model list, without a prefix. |
messages | array | Required. An ordered array of messages; each message has a role and content. At least one message. |
stream | boolean | true to receive the response incrementally via Server-Sent Events. |
max_tokens | integer | Maximum tokens in the response. If your balance can’t cover the requested value, the server may lower it automatically. |
temperature, top_p, stop | — | Passed to the model as is. Support and value ranges depend on the model. |
tools, tool_choice | array / object | OpenAI-format function calling (tool calling), passed to models that support it. |
Example request
curl https://ai.geraikita.com/v1/chat/completions \
-H "Authorization: Bearer gk-xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-5",
"messages": [{"role": "user", "content": "Hello!"}]
}'Example response
{
"id": "chatcmpl-…",
"object": "chat.completion",
"model": "claude-sonnet-5",
"choices": [
{
"index": 0,
"message": { "role": "assistant", "content": "…" },
"finish_reason": "stop"
}
],
"usage": { "prompt_tokens": 12, "completion_tokens": 9, "total_tokens": 21 }
}The usage object contains the token counts used for billing — see Pricing & billing.
Messages (Anthropic)
https://ai.geraikita.com/v1/messagesNative Anthropic endpoint for the Anthropic SDK and Claude Code CLI. Base URL in the client = https://ai.geraikita.com (without /v1).
Headers
| Header | Value | Description |
|---|---|---|
| x-api-key | gk-… | Your gk- API key (Authorization: Bearer is also accepted). |
| anthropic-version | 2023-06-01 | Anthropic API version; sent automatically by the SDK. |
| content-type | application/json | — |
Request body
| Parameter | Type | Description |
|---|---|---|
model | string | Required. The model id exactly as in the model list, without a prefix. |
messages | array | Required. An array of Anthropic-format messages, at least one message. |
max_tokens | integer | Maximum tokens in the response (required in the Anthropic format). |
system | string / array | System instructions (optional). |
stream | boolean | true to receive the response incrementally via Server-Sent Events. |
Example request
curl https://ai.geraikita.com/v1/messages \
-H "x-api-key: gk-xxxxxxxx" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{
"model": "claude-sonnet-5",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Hello!"}]
}'Need to count tokens before sending? POST https://ai.geraikita.com/v1/messages/count_tokens accepts the same body and is not billed.
List models
https://ai.geraikita.com/v1/modelsReturns the list of model ids you can send in the model field. When called with a key restricted by an allowlist, only the allowed models are shown. With the x-api-key or anthropic-version header, the response follows the Anthropic format.
curl https://ai.geraikita.com/v1/models \
-H "Authorization: Bearer gk-xxxxxxxx"Streaming (SSE)
With "stream": true, the response is sent as text/event-stream. The server sends headers immediately, then a : ka keepalive comment line every 10 seconds while waiting, so the connection isn’t treated as dead. Set your app’s total timeout to at least 300 seconds.
data: {"choices":[{"index":0,"delta":{"content":"Ha"}}]}
: ka
data: {"choices":[{"index":0,"delta":{"content":"lo!"}}]}
data: [DONE]- OpenAI format: each chunk is a
data:line containing JSON withchoices[].delta, ending withdata: [DONE]. - Anthropic format:
message_start,content_block_delta, …,message_stopevents, just like the Anthropic API. - Ignore lines that start with a colon (
:) — they are keepalives, not data. Per-tool guides are in Agentic tool settings.