loading
loading
Documentation
Drop-in OpenAI- and Anthropic-compatible interfaces for chat, responses and model listing. Authenticate with a Neko-AI API key and send requests to our base URL — that is all there is to it.
Four steps from an empty terminal to a streamed answer. Every example uses the environment variables set in steps one and two.
Create a key in the dashboard under API keys. The plaintext is shown once; only a SHA-256 hash is stored.
# Dashboard → API keys → Create key
# The plaintext is shown once; store it now.
export NEKO_API_KEY="sk-neko-xxxxxxxx"All endpoints are rooted at one base URL. The OpenAI SDK expects the /v1 suffix; the Anthropic SDK appends its own.
export NEKO_API_URL="https://inference.neko-build.tech/v1"curl "$NEKO_API_URL/chat/completions" \
-H "Authorization: Bearer $NEKO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "neko-1",
"messages": [
{ "role": "system", "content": "You are a helpful assistant." },
{ "role": "user", "content": "Explain load balancing in one sentence." }
]
}'Add stream: true and read the server-sent events as they arrive. Billing settles on the usage the stream reports.
curl -N "$NEKO_API_URL/chat/completions" \
-H "Authorization: Bearer $NEKO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "neko-1",
"stream": true,
"messages": [{ "role": "user", "content": "Count to five." }]
}'Create an API key in your dashboard under API keys. The plaintext key is shown once at creation time; only a hash is stored. Send it on every request in the Authorization header:
Authorization: Bearer sk-neko-xxxxxxxxKeep your key secret. Requests with a missing, malformed or revoked key return a 401 authentication_error.
All endpoints are rooted at a single base URL. Replace inference.neko-build.tech with your deployment host.
https://inference.neko-build.tech/v1| Method | Path | Description |
|---|---|---|
| Post | /v1/chat/completions | Create a chat completion. |
| Post | /v1/responses | Create a Responses API response. |
| Post | /v1/messages | Create an Anthropic-style message. |
| Get | /v1/models | List available models and pricing. |
/v1/chat/completionsGenerates a model response from a list of chat messages. Supports the standard OpenAI parameters.
| Name | Type | Required | Description |
|---|---|---|---|
| model | string | Required | The model id to run. Accepts the model id or display name. |
| messages | array | Required | Conversation history. Each item has a role (system, user, assistant) and content. |
| stream | boolean | optional | When true, tokens are returned as a server-sent event stream. |
| temperature | number | optional | Sampling temperature between 0 and 2. |
| max_tokens | number | optional | Maximum number of tokens to generate. Defaults to 4096; capped at 131072. |
| top_p | number | optional | Nucleus sampling probability mass. |
curl "$NEKO_API_URL/chat/completions" \
-H "Authorization: Bearer $NEKO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "neko-1",
"messages": [
{ "role": "system", "content": "You are a helpful assistant." },
{ "role": "user", "content": "Explain load balancing in one sentence." }
]
}'A successful response mirrors the OpenAI shape, including a usage object with prompt, completion, cache-read and cache-write token counts.
Set stream: true to receive tokens incrementally as server-sent events. The stream ends with a data: [DONE] sentinel and a final usage chunk.
curl -N "$NEKO_API_URL/chat/completions" \
-H "Authorization: Bearer $NEKO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "neko-1",
"stream": true,
"messages": [{ "role": "user", "content": "Count to five." }]
}'data: {"choices":[{"delta":{"role":"assistant"}}]}
data: {"choices":[{"delta":{"content":"one"}}]}
data: {"choices":[{"delta":{},"finish_reason":"stop"}],"usage":{"prompt_tokens":12,"completion_tokens":5}}
data: [DONE]With an SDK you can consume the async iterator directly:
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.NEKO_API_KEY, // "sk-neko-..."
baseURL: "https://inference.neko-build.tech/v1",
});
const stream = await client.chat.completions.create({
model: "neko-1",
messages: [{ role: "user", content: "Say hello." }],
stream: true,
});
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}/v1/responsesAn OpenAI-compatible Responses endpoint. Accepts input (a string or an array of input items) plus optional instructions, and returns a response object with an output array and output_text. Function tools are supported. Requests are translated to chat completions and billed identically.
curl "$NEKO_API_URL/responses" \
-H "Authorization: Bearer $NEKO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "neko-1",
"instructions": "You are a helpful assistant.",
"input": "Explain load balancing in one sentence."
}'Set stream: true to receive the Responses event sequence (response.created, response.output_text.delta, … response.completed).
curl -N "$NEKO_API_URL/responses" \
-H "Authorization: Bearer $NEKO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "neko-1",
"input": "Count to five.",
"stream": true
}'/v1/messagesAn Anthropic-compatible Messages endpoint for Claude clients. Authenticate with an x-api-key header (Bearer also works) and point the SDK's baseURL at the host without /v1. Text, images, PDF documents and tool calls are supported; streaming follows the standard Anthropic event sequence (message_start, content_block_delta, message_stop).
curl "https://inference.neko-build.tech/v1/messages" \
-H "x-api-key: sk-neko-xxxxxxxx" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-opus-5.5",
"max_tokens": 1024,
"messages": [{ "role": "user", "content": "Hello" }]
}'import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
apiKey: process.env.NEKO_API_KEY, // "sk-neko-..."
// No trailing /v1 — the SDK appends /v1/messages.
baseURL: "https://inference.neko-build.tech",
});
const message = await client.messages.create({
model: "claude-opus-5.5",
max_tokens: 1024,
messages: [{ role: "user", content: "Hello" }],
});PDFs are sent as Anthropic document blocks and require a document-capable model (currently claude-opus-5.5). Requests with documents are rejected with unsupported_document_input on models that cannot accept them.
import base64
from anthropic import Anthropic
client = Anthropic(
api_key="sk-neko-xxxxxxxx",
base_url="https://inference.neko-build.tech", # no /v1
)
with open("scan.pdf", "rb") as fh:
pdf = base64.b64encode(fh.read()).decode()
client.messages.create(
model="claude-opus-5.5",
max_tokens=1024,
messages=[{
"role": "user",
"content": [
{"type": "text", "text": "Summarize this document."},
{
"type": "document",
"source": {
"type": "base64",
"media_type": "application/pdf",
"data": pdf,
},
},
],
}],
)/v1/modelsReturns every enabled model along with its context window and per-token pricing.
curl "$NEKO_API_URL/models" \
-H "Authorization: Bearer $NEKO_API_KEY"{
"object": "list",
"data": [
{
"id": "neko-1",
"object": "model",
"created": 1730000000,
"owned_by": "neko-ai",
"display_name": "Neko-1",
"context_window": 1000000,
"pricing": {
"input": "0.3",
"output": "1.2",
"cache_read": "0.08",
"cache_write": "0.3"
}
}
]
}Every failure — the gateway, both compatibility layers and the website's own JSON APIs — uses one envelope:
{
"error": {
"message": "Model 'foo' does not exist or is disabled.",
"type": "invalid_request_error",
"code": "model_not_found",
"param": "model",
"request_id": "req_1f0c9a3e-5d2b-4a7e-9c1d-3b8f6e2a4c70",
"retry_after": null
}
}type and code are closed sets. param names the offending field when there is one; retry_after is filled on rate limits and capacity errors. The same request_id is returned in the x-request-id header:
HTTP/1.1 404 Not Found
content-type: application/json
x-request-id: req_1f0c9a3e-5d2b-4a7e-9c1d-3b8f6e2a4c70| Status | Code | Type | Remedy |
|---|---|---|---|
| 400 | invalid_request_error | invalid_request_error | The body or a query value is malformed. The message names the field. |
| 400 | api_key_spend_limit_exceeded | invalid_request_error | This key reached its spend cap. Raise the cap or use another key. |
| 400 | context_overflow | invalid_request_error | Prompt plus max_tokens exceeds the model context. Shorten it or pick a larger model. |
| 400 | unsupported_document_input | invalid_request_error | This model does not accept documents. Send text or use a document-capable model. |
| 401 | invalid_api_key | authentication_error | The key is missing, malformed or revoked. Send Authorization: Bearer sk-neko-…. |
| 402 | insufficient_quota | insufficient_quota | Balance is below the reservation. Top up, or retry on a cheaper model. |
| 404 | model_not_found | not_found_error | No enabled model has that id. List them with GET /v1/models. |
| 429 | rate_limit_error | rate_limit_error | Too many requests. Wait for retry_after seconds, then retry with backoff. |
| 499 | request_aborted | api_error | The client closed the connection. The reservation is released and nothing is billed. |
| 502 | upstream_server_error | api_error | The upstream returned a 5xx. Retry; the failed reservation was refunded. |
| 502 | upstream_rejected | api_error | The upstream refused the request. Retry once, then try a different model. |
| 502 | upstream_unreachable | api_error | The upstream could not be reached. Retry shortly. |
| 503 | no_upstream_capacity | api_error | Every account for that model was rate-limited or cooling down. Retry in a moment. |
| 500 | api_error | api_error | Unexpected gateway error. Retry, then quote the request id to the operator. |
Ready to make your first call?
Create an account, generate an API key and send a request — the first responses are minutes away.