API documentation
Arkheon mirrors the OpenAI API. Change base_url on https://arkheonchat.com/v1 and the key — the code keeps working, now with every model and a ruble account.
Quick start
- Sign up and confirm your email.
- Top up on the page Pricing.
- Create a key in your account. A key is shown once.
from openai import OpenAI
client = OpenAI(base_url="https://arkheonchat.com/v1", api_key="ark_...")
resp = client.chat.completions.create(
model="anthropic/claude-sonnet-4",
messages=[{"role": "user", "content": "Check this contract for risks"}],
)
print(resp.choices[0].message.content)
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://arkheonchat.com/v1", apiKey: "ark_..." });
const r = await client.chat.completions.create({
model: "google/gemini-2.5-flash",
messages: [{ role: "user", content: "Summarise this letter" }],
stream: true,
});
for await (const chunk of r) process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
curl https://arkheonchat.com/v1/chat/completions \
-H "Authorization: Bearer ark_..." \
-H "Content-Type: application/json" \
-d '{"model":"openai/gpt-4o-mini","messages":[{"role":"user","content":"Hello"}]}'
Keys
Pass the key in the header Authorization: Bearer ark_…. Up to 10 active keys per account, each can be revoked in your account. A key opens the API only — not the account and not the password.
POST /v1/chat/completions
Supported: model, messages (text, image_url, file), max_tokens / max_completion_tokens, temperature, top_p, stop, stream, tools, tool_choice, parallel_tool_calls, response_format, seed, presence_penalty, frequency_penalty, reasoning, modalities. Other fields are ignored; n must be 1.
The response is the standard OpenAI object. In addition it carries arkheon.credits_charged and arkheon.balance. If max_tokens is not given, 2048 is used; the maximum is 16,384.
Web search is switched on with the suffix :online of the model, for example openai/gpt-4o-mini:online.
Model auto picks the model for the request by itself: code, calculation, analysis of long documents, text or a quick answer. If "ask before expensive models" is on in your account, the API takes a model below the threshold instead of asking; pass "arkheon": {"allow_expensive": true} in the request body to allow an expensive one. The actual model comes back in arkheon.model, the reason for the choice is in arkheon.auto.
Streaming
"stream": true — the answer comes as text/event-stream, the last chunk contains usage, then data: [DONE]. Works with stream=True in the SDK.
Voice: transcription and speech
The same calls as OpenAI's. The names whisper-1, gpt-4o-transcribe, tts-1, gpt-4o-mini-tts and OpenAI's voices (alloy, coral, verse and the rest) are accepted and lead to our default models.
from openai import OpenAI
client = OpenAI(base_url="https://arkheonchat.com/v1", api_key="ark_...")
text = client.audio.transcriptions.create(
model="whisper-1", file=open("voice.ogg", "rb")).text
with client.audio.speech.with_streaming_response.create(
model="tts-1", voice="coral", input="Добрый день!") as r:
r.stream_to_file("answer.mp3")
POST /v1/audio/transcriptions
A file up to 25 MB and 60 minutes: mp3, wav, flac, ogg, m4a, webm, mp4. The answer comes as json, text, verbose_json, srt or vtt. You pay for the length of the recording; a recording with no speech in it is free.
POST /v1/audio/speech
Up to 4096 characters a request. Formats: mp3, opus, aac, flac, wav and pcm (24 kHz, 16-bit, mono); the audio streams as it is made. The price is counted by characters and comes in the header x-arkheon-credits-charged. The text goes through the same check as chat messages.
Models, voices and prices are in the answer of GET /v1/audio/models.
Live voice: /v1/realtime
A WebSocket in the OpenAI Realtime protocol. Clients written for gpt-realtime (the OpenAI SDK, Pipecat, LiveKit Agents) connect by changing the address and the key. Inside: speech recognition, a chat model from the catalog and speech sentence by sentence; the answer starts playing about 2–3 seconds after the end of a phrase.
wss://arkheonchat.com/v1/realtime?model=google/gemini-2.5-flash-lite
import OpenAI from "openai";
import { OpenAIRealtimeWS } from "openai/realtime/ws";
const client = new OpenAI({ baseURL: "https://arkheonchat.com/v1", apiKey: "ark_..." });
const rt = await OpenAIRealtimeWS.create(client, { model: "gpt-realtime" });
rt.on("response.output_audio.delta", (e) => play(Buffer.from(e.delta, "base64")));
rt.send({ type: "input_audio_buffer.append", audio: pcm16.toString("base64") });
- The model is set with the parameter
model: any chat model from the catalog. Without it, or with an OpenAI model name, the answer comes fromgoogle/gemini-2.5-flash-lite. - Audio: pcm16 at 24 kHz, or G.711 (audio/pcmu, audio/pcma) for telephony.
- Supported: server-side pause detection or manual commits, interrupting, cancelling an answer, truncating what was heard, function calling, text-only answers, GA and beta events.
- Not supported: WebRTC, SIP, images and MCP.
From a server, the key goes in the header Authorization. Don't give the key to a browser: your server gets a one-time token with POST /v1/realtime/client_secrets, and the page passes it in the subprotocol openai-insecure-api-key.<token>. The token lives 60 seconds and opens one connection; an ark_ key in the subprotocol is refused.
You pay per answer, for recognition, the model and speech together, usually 1 credit an answer. An answer cancelled before its first sound is free. Up to 5 sessions at a time, each up to 30 minutes. Audio and transcripts are not stored.
GET /v1/models
The list of available models. credits_per_answer — the approximate price of a typical answer (300 tokens in and 500 out), not a flat price: the actual cost by tokens is charged, and prices per 1000 tokens are in credits_per_1k_input_tokens and credits_per_1k_output_tokens. Long context — documents, notes, history — is paid for again in every request. Identifiers of the form vendor/model. Below are the cheapest of 178.
| id | Name | Class | Answer |
|---|---|---|---|
amazon/nova-lite-v1 | Amazon: Nova Lite 1.0 | fast | ≈1 cr |
amazon/nova-micro-v1 | Amazon: Nova Micro 1.0 | fast | ≈1 cr |
bytedance/ui-tars-1.5-7b | ByteDance: UI-TARS 7B | fast | ≈1 cr |
cohere/command-r-08-2024 | Cohere: Command R (08-2024) | fast | ≈1 cr |
cohere/command-r7b-12-2024 | Cohere: Command R7B (12-2024) | fast | ≈1 cr |
deepseek/deepseek-chat-v3-0324 | DeepSeek: DeepSeek V3 0324 | fast | ≈1 cr |
deepseek/deepseek-v3.1-terminus | DeepSeek: DeepSeek V3.1 Terminus | fast | ≈1 cr |
deepseek/deepseek-v3.2 | DeepSeek: DeepSeek V3.2 | fast | ≈1 cr |
deepseek/deepseek-v3.2-exp | DeepSeek: DeepSeek V3.2 Exp | fast | ≈1 cr |
deepseek/deepseek-v4-flash | DeepSeek: DeepSeek V4 Flash 0423 | fast | ≈1 cr |
deepseek/deepseek-v4-flash-0731 | DeepSeek: DeepSeek V4 Flash 0731 | fast | ≈1 cr |
deepseek/deepseek-v4-flash-vision-exp | DeepSeek: DeepSeek V4 Flash Vision Exp | fast | ≈1 cr |
google/gemini-2.5-flash-lite | Google: Gemini 2.5 Flash Lite | fast | ≈1 cr |
google/gemma-2-27b-it | Google: Gemma 2 27B | fast | ≈1 cr |
The full list is in the response /v1/models or in the model picker in the chat.
Billing
Before a request an estimate is held on the balance (it accounts for max_tokens). After the answer the actual cost reported by the provider is charged and the rest of the hold is returned at once. 1 credit ≈ 1 ₽, the minimum charge is 1 credit. Empty answers and provider errors are not charged. Balance: GET /v1/balance.
GET /v1/usage
Statistics for the key the request is signed with: ?days=30 (1–90). The answer contains total (requests, tokens, credits), by_day (a dense series by day), by_model. A key sees only itself; the whole picture of the account is in your account.
curl https://arkheonchat.com/v1/usage?days=7 -H "Authorization: Bearer ark_..."
{"object":"usage","scope":"key","key":{"id":12,"name":"Бот поддержки","prefix":"ark_3f"},
"period":{"from":"2026-08-27","to":"2026-09-02","days":7},
"total":{"requests":418,"prompt_tokens":91230,"completion_tokens":40211,"cached_tokens":0,"credits":612},
"by_day":[{"date":"2026-08-27","requests":51,"credits":80,...}],
"by_model":[{"model":"openai/gpt-4o-mini","requests":390,"credits":402,...}]}
Errors and limits
Errors have the OpenAI shape: {"error": {"message", "type", "code"}}.
| HTTP | code | When |
|---|---|---|
| 401 | invalid_api_key | The key is missing, revoked or wrong |
| 402 | insufficient_credits | Not enough credits for the hold. The response contains needed and available |
| 404 | model_not_found | Model unavailable |
| 429 | rate_limited | More than 60 requests a minute per key, or more than 4 at once |
| 502 / 504 | upstream_error / upstream_timeout | The provider returned an error or nothing — no credits charged |