API Reference
Technical specifications for the Run CC API gateway. The gateway provides chat completions, embeddings, models, usage, and health check endpoints that return JSON.
| Method | Endpoint | Summary |
|---|---|---|
| POST | /v1/chat/completions | Creates a model response for a chat conversation. |
| POST | /v1/responses | A Chat Completions alternative using the Responses API shape. |
| POST | /v1/messages | Anthropic Messages API compatible (x-api-key), streaming included. |
| POST | /v1/embeddings | Creates embedding vectors representing the input text. |
| GET | /v1/models | Retrieves the models enabled on the gateway, along with owner metadata. |
| GET | /v1/usage | Returns a summary of your key quota and usage over the last 7 days. |
| GET | /healthz | Gateway health check for automated monitoring. |
Looking for image, audio, or video endpoints? Open Media & Utilities →
/v1/chat/completions
Creates a model response for a chat conversation.
Automatic Fallback System
The gateway automatically fails over to a backup model if an upstream provider has a connection issue or rate limit.
Request body
| Parameter | Type & description |
|---|---|
| modelRequired | string — The model ID to use. See GET /v1/models for the list of available models. |
| messagesRequired | array of objects — The list of messages that make up the conversation so far. Each object must contain at least role (system, user, assistant) and content. |
| streamOptional | boolean · Default: false — When set to true, message deltas are streamed progressively (Server-Sent Events) as tokens become available. |
curl https://runccai.store/v1/chat/completions \ -H "Authorization: Bearer runcc-..." \ -H "Content-Type: application/json" \ -d '{ "model": "deepseek-v4.1-flash", "messages": [{"role": "user", "content": "Halo dari Run CC!"}] }'
from openai import OpenAI client = OpenAI(api_key="runcc-...", base_url="https://runccai.store/v1") response = client.chat.completions.create( model="deepseek-v4.1-flash", messages=[{"role": "user", "content": "Halo dari Run CC!"}] ) print(response.choices[0].message.content)
import OpenAI from 'openai'; const openai = new OpenAI({ apiKey: 'runcc-...', baseURL: 'https://runccai.store/v1'}); const response = await openai.chat.completions.create({ model: 'deepseek-v4.1-flash', messages: [{ role: 'user', content: 'Halo dari Run CC!' }], }); console.log(response.choices[0].message.content);
{
"id": "chatcmpl-7f9c2a8b1d",
"object": "chat.completion",
"created": 1791626120,
"model": "deepseek-v4.1-flash",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Halo dari Run CC! Ada yang bisa saya bantu hari ini?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 9,
"completion_tokens": 12,
"total_tokens": 21
}
}
/v1/responses
Same as Chat Completions, but using the OpenAI Responses API shape (instructions + input[]) — replies are wrapped as a Response object.
Request body
| Parameter | Type & description |
|---|---|
| modelRequired | string — The model ID to use. See GET /v1/models for the list of available models. |
| inputRequired | string | array Conversation input: string or item array (message / function_call / function_call_output). |
| instructionsOptional | string System-level instructions, mapped to the system message. |
| streamOptional | boolean · Default: false — When set to true, message deltas are streamed progressively (Server-Sent Events) as tokens become available. |
/v1/messages
Anthropic Messages API-compatible endpoint — send system + messages with an x-api-key or Bearer header. Anthropic-style streaming events and token counting (count_tokens) included.
Request body
| Parameter | Type & description |
|---|---|
| modelRequired | string — The model ID to use. See GET /v1/models for the list of available models. |
| messagesRequired | array Conversation history: user/assistant roles; text, image, tool_use, and tool_result blocks are supported. |
| systemOptional | string | array Top-level system instructions — mapped to the system message. |
| max_tokensOptional | integer Output token cap for the reply (optional on this gateway). |
| streamOptional | boolean · Default: false — When set to true, message deltas are streamed progressively (Server-Sent Events) as tokens become available. |
/v1/embeddings
Creates embedding vectors representing the input text.
Request body
| Parameter | Type & description |
|---|---|
| modelRequired | string — The embedding model ID active on the gateway. |
| inputRequired | string | array of strings — The text to vectorize. Send an array to process multiple texts in a single request. |
| encoding_formatOptional | string · Default: float — Output vector format: float or base64. |
| dimensionsOptional | integer — Output vector dimensions, for models that support dimension truncation. |
curl https://runccai.store/v1/embeddings \ -H "Authorization: Bearer runcc-..." \ -H "Content-Type: application/json" \ -d '{ "model": "text-embedding-3-small", "input": "Run CC menyatukan akses LLM dalam satu gateway." }'
from openai import OpenAI client = OpenAI(api_key="runcc-...", base_url="https://runccai.store/v1") response = client.embeddings.create( model="text-embedding-3-small", input="Run CC menyatukan akses LLM dalam satu gateway." ) print(response.data[0].embedding[:8])
import OpenAI from 'openai'; const openai = new OpenAI({ apiKey: 'runcc-...', baseURL: 'https://runccai.store/v1'}); const response = await openai.embeddings.create({ model: 'text-embedding-3-small', input: 'Run CC menyatukan akses LLM dalam satu gateway.', }); console.log(response.data[0].embedding.slice(0, 8));
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [
0.0023064255,
-0.009327292,
-0.0028842222
]
}
],
"model": "text-embedding-3-small",
"usage": {
"prompt_tokens": 8,
"total_tokens": 8
}
}
/v1/models
Retrieves the models enabled on the gateway, along with owner metadata.
Model types
The catalogue is split by family: chat (LLM), image, video, tts and stt. Add the ?type= filter to /v1/models to list one family only; every entry carries a type field.
curl https://runccai.store/v1/models?type=image \ -H "Authorization: Bearer ***" # type: chat | image | video | tts | stt — tanpa ?type hanya berisi katalog kamu
curl https://runccai.store/v1/models \ -H "Authorization: Bearer runcc-..."
from openai import OpenAI client = OpenAI(api_key="runcc-...", base_url="https://runccai.store/v1") models = client.models.list() print(models.data)
import OpenAI from 'openai'; const openai = new OpenAI({ apiKey: 'runcc-...', baseURL: 'https://runccai.store/v1'}); const models = await openai.models.list(); console.log(models.data);
{
"object": "list",
"data": [
{
"id": "deepseek-v4.1-flash",
"object": "model",
"owned_by": "openai"
},
{
"id": "deepseek-v4.1-flash",
"object": "model",
"owned_by": "deepseek"
}
]
}
/v1/usage
Returns a summary of your key quota and usage over the last 7 days.
Requestcurl https://runccai.store/v1/usage \ -H "Authorization: Bearer runcc-..."
import requests headers = {"Authorization": "Bearer runcc-..."} response = requests.get("https://runccai.store/v1/usage", headers=headers) print(response.json())
const response = await fetch('https://runccai.store/v1/usage', { headers: { 'Authorization': 'Bearer runcc-...' } }); console.log(await response.json());
{
"object": "usage",
"key": "runcc-...abcd",
"window_days": 7,
"quota": {
"limit_total": 10000000,
"used": 10070,
"remaining": 9989930,
"limit_daily": 1000000,
"used_today": 0,
"remaining_today": 1000000,
"bonus_tokens": 0,
"active_until": 1793993668
},
"used_7d": { "requests": 36, "success": 35, "tokens": 10070 }
}
Handling Quota Exhaustion
When remaining or remaining_today reaches 0, the gateway responds with 429 (insufficient_quota). Top up your plan or wait for the daily reset. See Status Codes.
/healthz
A JSON health check for automated monitoring. The response is always HTTP 200; check the status and components fields for actual health. No authentication is required.
Requestcurl https://runccai.store/healthz
import requests response = requests.get("https://runccai.store/healthz") print(response.json())
const response = await fetch('https://runccai.store/healthz'); console.log(await response.json());
{
"status": "operational",
"environment": "production",
"uptime_seconds": 1706,
"version": "1.0.0",
"components": {
"api_gateway": "healthy",
"database": "healthy"
},
"timestamp": 1791626120
}
Media & utility endpoints use the same gateway key. Availability follows live provider capability: when no capable upstream is connected, the gateway answers 501 honestly instead of a canned response.
| Method | Endpoint | Summary |
|---|---|---|
| POST | /v1/images/generations | Generate images from a text prompt (b64_json). |
| POST | /v1/audio/speech | text-to-speech, returns audio bytes |
| GET | /v1/audio/voices | aggregated voice list |
| POST | /v1/audio/transcriptions | speech-to-text from a multipart file or base64 JSON |
| POST | /v1/videos/generations | Submit an asynchronous video job, then poll its status. |
| GET | /v1/videos/{id} | Poll the job until status is completed; the finished clips are listed in the polling response (unsigned_urls). |
| POST | /v1/search | web search |
| POST | /v1/scrape | Fetch a web page and return clean text — runs natively in the gateway. |
| POST | /v1/systemone | typed answers (System One) |
Looking for chat, embeddings, or the model catalog? Open Chat & Text →
/v1/images/generations
Generate images from a text prompt. The response returns the image as base64 (b64_json) plus usage where the upstream reports it.
Availability is real
A media model is listed only when a provider that actually supports the family is connected and active. Unknown model gives 404; a family without capability gives 501. Nothing is faked.
If the upstream account hits its credit or billing wall, the gateway answers HTTP 402 upstream_billing and forwards the upstream message verbatim, so you always know the real cause.
Request body
| Parameter | Type & description |
|---|---|
| modelRequired | string Image model from your catalogue (see ?type=image). |
| promptRequired | string Text description of the image. |
| sizeOptional | string Output size, e.g. 1024x1024 or 1024x1536. |
| output_formatOptional | string Output format when the upstream supports it (png, webp, jpeg). |
curl https://runccai.store/v1/images/generations \ -H "Authorization: Bearer ***" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-image", "prompt": "kucing oren di dermaga saat senja, cinematic", "size": "1024x1024" }'
{
"created": 1791626120,
"model": "gpt-image",
"data": [ { "b64_json": "iVBORw0KGgo…" } ],
"usage": { "total_tokens": 12 }
}
/v1/audio/speech
Convert text into speech. The response is raw audio bytes (audio/mpeg), ready to write to a file.
curl https://runccai.store/v1/audio/speech \ -H "Authorization: Bearer ***" \ -H "Content-Type: application/json" \ -d '{ "model": "runcc-voice", "input": "Halo dari Run CC!", "voice": "mock-voice-a", "response_format": "mp3" }' \ --output suara.mp3
/v1/audio/voices
List of available voices from active providers (aggregated, cached for 5 minutes).
curl https://runccai.store/v1/audio/voices \ -H "Authorization: Bearer ***"
{
"object": "list",
"total": 145,
"data": [ { "id": "mock-voice-a", "name": "Mock Voice A", "locale": "en-US", "gender": "female" } ]
}
/v1/audio/transcriptions
Transcribe audio into text — send a multipart file or base64 JSON (input_audio).
curl https://runccai.store/v1/audio/transcriptions \ -H "Authorization: Bearer ***" \ -F model=openai/whisper-large-v3 \ -F file=@rekaman.mp3 \ -F language=id # alternatif JSON (audio base64): {"model": "...", "input_audio": "aGVsbG8="}
{
"text": "transkrip uji",
"usage": { "total_tokens": 5 }
}
/v1/videos/generations
Video generation is asynchronous: submit a job, then poll its status endpoint. polling_url is rewritten to this gateway origin, so you never need the upstream address.
Requestcurl https://runccai.store/v1/videos/generations \ -H "Authorization: Bearer ***" \ -H "Content-Type: application/json" \ -d '{ "model": "google/veo-3.1", "prompt": "drone shot pantai tropis saat pagi", "aspect_ratio": "16:9" }'
{
"id": "job-mock-1",
"status": "pending",
"polling_url": "https://runccai.store/v1/videos/job-mock-1"
}
/v1/videos/edits · /v1/videos/extensions — video edit and extension jobs use the same request shape with previous_job_id.
/v1/videos/{id}
Poll the job until status is completed; the finished clips are listed in the polling response (unsigned_urls).
curl https://runccai.store/v1/videos/job-mock-1 \ -H "Authorization: Bearer ***" # status: pending → in_progress → completed (unsigned_urls berisi hasil)
/v1/search
Web search for agents — returns a list of results (title, URL, snippet).
curl https://runccai.store/v1/search \ -H "Authorization: Bearer ***" \ -H "Content-Type: application/json" \ -d '{"query": "berita AI hari ini", "max_results": 5}'
{
"query": "berita AI hari ini",
"results": [ { "title": "…", "url": "https://…", "snippet": "…" } ]
}
/v1/scrape
fetch a page and return clean text (title plus body). It runs on the gateway itself: http(s) only, private hosts blocked.
curl https://runccai.store/v1/scrape \ -H "Authorization: Bearer ***" \ -H "Content-Type: application/json" \ -d '{"url": "https://example.com/artikel"}'
{
"url": "https://example.com/artikel",
"content_type": "text/html",
"title": "Judul Halaman",
"text": "isi halaman dalam teks bersih…",
"length": 4210
}
/v1/systemone
Structured (typed) answers — send schema-scoped questions, receive answers in the declared format.
curl https://runccai.store/v1/systemone \ -H "Authorization: Bearer ***" \ -H "Content-Type: application/json" \ -d '{ "model": "typesafe/jev-latest", "questions": { "is_bug": { "type": "noul" } }, "state": { "code": "print(1)" } }'
{
"id": "gen-dec-mock-1",
"answers": { "is_bug": { "type": "noul", "noul": 0.9 } }
}
© 2026 Run CC.