MenuAPI reference

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).

EndpointPurpose
POST /v1/chat/completionsOpenAI-format chat (stream & non-stream)
POST /v1/messagesAnthropic-format messages (stream & non-stream)
POST /v1/messages/count_tokensCount Anthropic-format prompt tokens — free
GET /v1/modelsList of available models
POST /v1/images/generationsGenerate images from a text prompt, billed per image — see Image generation
Only the endpoints above are available at the moment. Other OpenAI endpoints (e.g. /v1/responses, /v1/embeddings) are not supported yet.

Chat completions (OpenAI)

POSThttps://ai.geraikita.com/v1/chat/completions

Generates a response from a list of messages. Headers: Authorization: Bearer gk-… and Content-Type: application/json.

Request body

ParameterTypeDescription
modelstringRequired. The model id exactly as in the model list, without a prefix.
messagesarrayRequired. An ordered array of messages; each message has a role and content. At least one message.
streambooleantrue to receive the response incrementally via Server-Sent Events.
max_tokensintegerMaximum 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_choicearray / objectOpenAI-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

200 OK · application/json
{
  "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)

POSThttps://ai.geraikita.com/v1/messages

Native Anthropic endpoint for the Anthropic SDK and Claude Code CLI. Base URL in the client = https://ai.geraikita.com (without /v1).

Headers

HeaderValueDescription
x-api-keygk-…Your gk- API key (Authorization: Bearer is also accepted).
anthropic-version2023-06-01Anthropic API version; sent automatically by the SDK.
content-typeapplication/json—

Request body

ParameterTypeDescription
modelstringRequired. The model id exactly as in the model list, without a prefix.
messagesarrayRequired. An array of Anthropic-format messages, at least one message.
max_tokensintegerMaximum tokens in the response (required in the Anthropic format).
systemstring / arraySystem instructions (optional).
streambooleantrue 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

GEThttps://ai.geraikita.com/v1/models

Returns 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.

text/event-stream
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 with choices[].delta, ending with data: [DONE].
  • Anthropic format: message_start, content_block_delta, …, message_stop events, 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.