Get started free
Developer docs

NexusAI API Reference

One API key for every model. The API is fully OpenAI-compatible and also speaks the Anthropic Messages protocol natively; routing, failover, billing and auditing happen behind the scenes.

Base URL https://www.telcq.com/v1

Quickstart

  1. Sign up and open the console; an organization admin tops up and allocates funds to teams.
  2. Create a key for a team on the API Keys page (it starts with sk-nx-). It is shown only once, so store it safely.
  3. Point your SDK's base URL at the address above and use your key; leave the rest of your code as is.
curl https://www.telcq.com/v1/chat/completions \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-r1",
    "messages": [{"role": "user", "content": "Hello"}]
  }'
# pip install openai
import os
from openai import OpenAI

client = OpenAI(base_url="https://www.telcq.com/v1", api_key=os.environ["NEXUS_API_KEY"])
resp = client.chat.completions.create(
    model="deepseek-r1",
    messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content)
// npm install openai
import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://www.telcq.com/v1", apiKey: process.env.NEXUS_API_KEY });
const resp = await client.chat.completions.create({
  model: "deepseek-r1",
  messages: [{ role: "user", content: "Hello" }],
});
console.log(resp.choices[0].message.content);

Authentication

Every request needs an API key in one of these headers:

Authorization: Bearer sk-nx-xxxxxxxx      # OpenAI SDK
x-api-key: sk-nx-xxxxxxxx                  # Anthropic SDK

Keys belong to a team and calls are charged to that team's wallet. Admins can give each key an expiry, a model allowlist, an IP/CIDR allowlist, RPM/TPM limits and a spending limit. Never ship keys in browser or mobile code.

Endpoints

MethodPathDescription
POST/v1/chat/completionsChat completions (OpenAI format) with streaming, tool calls and multimodal input
POST/v1/messagesAnthropic Messages format with streaming, tool use and thinking blocks
POST/v1/messages/count_tokensEstimate input tokens (not billed)
POST/v1/embeddingsText embeddings
POST/v1/images/generationsImage generation, billed per image
POST/v1/audio/speechSpeech synthesis (TTS), billed per character
POST/v1/audio/transcriptionsTranscription (STT), billed per minute
GET/v1/modelsModels available to the current key

Any model can be called through either protocol: requests and streams are translated between OpenAI, Anthropic and Gemini upstream formats automatically.

Chat completions

The request body matches OpenAI Chat Completions. Set stream: true for an SSE stream, and stream_options.include_usage to get usage at the end of the stream.

curl https://www.telcq.com/v1/chat/completions \
  -H "Authorization: Bearer $NEXUS_API_KEY" -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-r1",
    "stream": true,
    "stream_options": {"include_usage": true},
    "max_tokens": 1024,
    "messages": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "Introduce yourself in one sentence"}
    ]
  }'

Without max_tokens, the model's default maximum output is used to estimate the worst-case cost for the balance check; you are charged only for actual usage.

Anthropic SDK & Claude Code

The Anthropic SDK appends /v1/messages to the base URL itself, so leave /v1 off here:

import anthropic

client = anthropic.Anthropic(base_url="https://www.telcq.com", api_key="sk-nx-xxxxxxxx")
msg = client.messages.create(
    model="claude-3-7-sonnet",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello"}],
)
print(msg.content[0].text)

With Claude Code:

export ANTHROPIC_BASE_URL=https://www.telcq.com
export ANTHROPIC_AUTH_TOKEN=sk-nx-xxxxxxxx
claude

Embeddings

curl https://www.telcq.com/v1/embeddings \
  -H "Authorization: Bearer $NEXUS_API_KEY" -H "Content-Type: application/json" \
  -d '{"model": "text-embedding-3-small", "input": ["first passage", "second passage"]}'

Image generation

curl https://www.telcq.com/v1/images/generations \
  -H "Authorization: Bearer $NEXUS_API_KEY" -H "Content-Type: application/json" \
  -d '{"model": "dall-e-3", "prompt": "a lighthouse at dawn, watercolor", "n": 1, "size": "1024x1024"}'

Billed per generated image (see the pricing page).

Speech & transcription

# Text to speech: returns audio bytes
curl https://www.telcq.com/v1/audio/speech \
  -H "Authorization: Bearer $NEXUS_API_KEY" -H "Content-Type: application/json" \
  -d '{"model": "tts-1", "input": "Hello and welcome.", "voice": "alloy"}' \
  --output hello.mp3

# Speech to text: multipart upload, 25 MB max per file
curl https://www.telcq.com/v1/audio/transcriptions \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -F model=whisper-1 -F [email protected] -F response_format=srt

TTS is billed per input character; STT per minute of audio. response_format accepts json, text, verbose_json, srt and vtt.

Model list

GET /v1/models lists the models the current key may call; send an anthropic-version header to get the Anthropic shape. For full prices see the pricing page.

Error codes

Error bodies follow the protocol you called:

{"error": {"message": "...", "type": "insufficient_quota", "code": "insufficient_quota"}}          // OpenAI
{"type": "error", "error": {"type": "rate_limit_error", "message": "..."}}                  // Anthropic
HTTPcodeMeaning and what to do
400invalid_json / model_requiredThe body is not valid JSON, or model is missing
400model_not_supportedThe model does not support this endpoint (e.g. a chat model on the embeddings endpoint)
400content_blockedThe request matched the organization's blocking DLP rules
401invalid_api_key / api_key_expiredThe key does not exist, was revoked or has expired
403model_not_allowed / ip_not_allowedThe key's model or IP allowlist does not permit this call
403organization_suspendedThe organization is suspended; contact the platform
404model_not_foundThe model does not exist or was retired
413file_too_largeThe uploaded audio file exceeds 25 MB
429rate_limit_exceededKey or team RPM/TPM exceeded; retry shortly
429insufficient_quotaThe team wallet is too low; top up or ask an admin to allocate funds
429spend_limit_reached / team_model_quota_exceededKey spending limit or team monthly model quota reached
502upstream_unavailableAll upstream channels failed; retry later
503no_available_channelThe model has no available channel right now (e.g. all circuits open)

Upstream 4xx errors (such as invalid parameters) are passed through unchanged and not billed; 5xx errors and timeouts fail over to the next channel.

Rate limits, quotas & budgets

  • RPM / TPM: set on keys and on teams, counted per minute; excess calls return 429 rate_limit_exceeded.
  • Key spending limit: monthly or lifetime; once reached, calls return 429 spend_limit_reached.
  • Team model quotas: cap a team's monthly tokens or spend per model.
  • Balance admission: before each call the team balance is checked against estimated input plus maximum output; calls it cannot cover are refused, so large overdrafts cannot happen.

Retry 429 and 5xx responses with exponential backoff; the official OpenAI and Anthropic SDKs already do this by default.

Billing

  • Chat models: input tokens × input price + output tokens × output price, priced per 1M tokens.
  • Usage comes from the upstream response; when missing it is estimated locally and marked “estimated” in the call log.
  • With the response cache on, cache hits are charged at the platform's cache ratio.
  • Every call records model, channel, usage, cost, latency and time to first token — browse and export them as CSV in the console's call log.