API reference

The Alpha Codec API is compatible with the OpenAI Chat Completions API. Base URL: https://ai.alphacodec.scify-tech.com/v1

Authentication

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_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Quickstart

curl
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"}]}'
Python (openai SDK)
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)
Node.js (openai SDK)
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

FieldTypeDescription
modelstringModel id, e.g. alpha-codec-2.8. Must be enabled for your plan.
messagesarrayConversation 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).
streambooleanStream tokens as Server-Sent Events. Default false.
stream_options.include_usagebooleanSend a final chunk with token usage when streaming.
max_tokens / max_completion_tokensintegerMaximum output tokens (includes reasoning tokens). Capped by the model and your plan.
temperaturenumber0–2. Ignored by models that do not support sampling controls.
top_pnumber0–1.
stopstring | string[]Up to 4 stop sequences.
response_formatobject{"type":"json_object"} or {"type":"json_schema","json_schema":{"schema":{...}}}.
reasoning_effortstringlow | medium | high (reasoning-capable models).
userstringOptional 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.

Response
{
  "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"
Response (abridged)
{
  "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

FieldTypeDescription
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"}}.

FieldTypeDescription
400invalid_request_errorMalformed request, unsupported parameter, or context_length_exceeded.
401authentication_errorMissing, invalid, expired, or revoked API key.
402insufficient_quotaYour credit balance cannot cover the request (insufficient_credits).
404not_found_errorUnknown model or one not enabled for your plan (model_not_found).
413invalid_request_errorRequest body too large (25 MB; 15 MB of inline media).
429rate_limit_errorRate limit, daily or monthly limit, or capacity exhausted. Honour the Retry-After header.
503api_errorThe model is temporarily unavailable. Retry with exponential backoff.
504api_errorThe 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.