API reference
https://ai.alphacodec.scify-tech.com/v1Authentication
Create a key in Dashboard → API keys and send it as a bearer token. Keep keys server-side; never embed them in browser or mobile apps.
Authorization: Bearer ac_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxQuickstart
curl https://ai.alphacodec.scify-tech.com/v1/chat/completions \
-H "Authorization: Bearer $ALPHA_CODEC_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "alpha-codec-2.8", "messages": [{"role": "user", "content": "Hello"}]}'from openai import OpenAI
client = OpenAI(base_url="https://ai.alphacodec.scify-tech.com/v1", api_key="ac_live_...")
resp = client.chat.completions.create(
model="alpha-codec-2.8",
messages=[{"role": "user", "content": "Write a haiku about compilers"}],
)
print(resp.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://ai.alphacodec.scify-tech.com/v1", apiKey: process.env.ALPHA_CODEC_API_KEY });
const stream = await client.chat.completions.create({
model: "alpha-codec-2.8",
messages: [{ role: "user", content: "Explain SSE in one paragraph" }],
stream: true,
});
for await (const chunk of stream) process.stdout.write(chunk.choices[0]?.delta?.content ?? "");POST /v1/chat/completions
| Field | Type | Description |
|---|---|---|
| model | string | Model id, e.g. alpha-codec-2.8. Must be enabled for your plan. |
| messages | array | Conversation so far. Roles: system, developer, user, assistant. User content may include text parts and base64 data-URL images (image_url) or PDFs (file.file_data). |
| stream | boolean | Stream tokens as Server-Sent Events. Default false. |
| stream_options.include_usage | boolean | Send a final chunk with token usage when streaming. |
| max_tokens / max_completion_tokens | integer | Maximum output tokens (includes reasoning tokens). Capped by the model and your plan. |
| temperature | number | 0–2. Ignored by models that do not support sampling controls. |
| top_p | number | 0–1. |
| stop | string | string[] | Up to 4 stop sequences. |
| response_format | object | {"type":"json_object"} or {"type":"json_schema","json_schema":{"schema":{...}}}. |
| reasoning_effort | string | low | medium | high (reasoning-capable models). |
| user | string | Optional end-user identifier for your own tracking. |
Not supported yet: tools / function calling, n > 1, remote image URLs, audio input. These return HTTP 400 with a clear message.
{
"id": "chatcmpl-8Hk2...",
"object": "chat.completion",
"created": 1793500000,
"model": "alpha-codec-2.8",
"choices": [{
"index": 0,
"message": { "role": "assistant", "content": "Hello! How can I help?" },
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 12, "completion_tokens": 9, "total_tokens": 21,
"prompt_tokens_details": { "cached_tokens": 0 },
"completion_tokens_details": { "reasoning_tokens": 0 }
}
}Every response carries an x-request-id header. Quote it when contacting support.
Streaming
With "stream": true the response is text/event-stream. Each event is a chat.completion.chunk; the stream ends with data: [DONE]. Lines beginning with : are keep-alive comments. If an error occurs after streaming has started, an event with an error object is sent before [DONE]. Closing the connection stops generation; you are billed for the tokens generated up to that point.
data: {"id":"chatcmpl-...","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null}]}
data: {"id":"chatcmpl-...","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":"Hel"},"finish_reason":null}]}
data: {"id":"chatcmpl-...","object":"chat.completion.chunk","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}
data: {"id":"chatcmpl-...","object":"chat.completion.chunk","choices":[],"usage":{"prompt_tokens":12,"completion_tokens":9,"total_tokens":21}}
data: [DONE]GET /v1/models
Lists the models enabled for your account, with context window, output limit, and per-million-token prices. GET /v1/models/{id} returns one model.
GET /v1/usage
Token usage and cost. Defaults to the current billing period. Query parameters: start_date and end_date (YYYY-MM-DD), and scope=key to report only the calling key.
curl "https://ai.alphacodec.scify-tech.com/v1/usage?start_date=2026-11-01&end_date=2026-11-30" -H "Authorization: Bearer $ALPHA_CODEC_API_KEY"{
"object": "usage",
"period": { "start": "2026-11-01T00:00:00.000Z", "end": "2026-11-30T23:59:59.999Z" },
"totals": { "requests": 42, "input_tokens": 51200, "output_tokens": 18300, "cost_usd": 0.285 },
"by_model": [{ "model": "alpha-codec-2.8", "requests": 40, "cost_usd": 0.27 }],
"daily": [{ "date": "2026-11-01", "requests": 12, "cost_usd": 0.08 }],
"credits": { "balance_usd": 9.71 }
}API keys
| Field | Type | Description |
|---|---|---|
| GET /v1/keys | — | List your keys (prefix, last four characters, status, last use). Full keys are never returned. |
| POST /v1/keys | { name, expires_at?, rpm_limit? } | Create a key. The response contains the full key once. |
| DELETE /v1/keys/{id} | — | Revoke a key immediately. |
Errors
Errors use the OpenAI shape: {"error": {"message", "type", "param", "code"}}.
| Field | Type | Description |
|---|---|---|
| 400 | invalid_request_error | Malformed request, unsupported parameter, or context_length_exceeded. |
| 401 | authentication_error | Missing, invalid, expired, or revoked API key. |
| 402 | insufficient_quota | Your credit balance cannot cover the request (insufficient_credits). |
| 404 | not_found_error | Unknown model or one not enabled for your plan (model_not_found). |
| 413 | invalid_request_error | Request body too large (25 MB; 15 MB of inline media). |
| 429 | rate_limit_error | Rate limit, daily or monthly limit, or capacity exhausted. Honour the Retry-After header. |
| 503 | api_error | The model is temporarily unavailable. Retry with exponential backoff. |
| 504 | api_error | The model did not respond in time. |
Rate limits
Limits depend on your plan (requests per minute, optional daily requests and monthly tokens) and can also be set per API key. When a limit is reached the API returns HTTP 429 with a Retry-After header in seconds. Retry with exponential backoff and jitter.