BYOK Platform now supports 7 vendors — 17 models in one API · Try free →

BYOK Platform – API Documentation

AimActok BYOK Platform — API Documentation

The gateway exposes an OpenAI-compatible API. If you’ve used the OpenAI Python SDK or curl with OpenAI before, you already know most of this.

Authentication

All API calls (except /auth/register and /auth/login) require a JWT token in the Authorization header:

Authorization: Bearer YOUR_JWT_TOKEN

Get a token by registering or logging in. Tokens are valid for 7 days.

Register

POST /auth/register
Content-Type: application/json

{
  "email": "you@example.com",
  "password": "YourSecurePass123"
}

Response 201:

{
  "user": {"id": 1, "email": "you@example.com"},
  "token": "eyJ...",
  "expires_in": 604800
}

Login

POST /auth/login
Content-Type: application/json

{
  "email": "you@example.com",
  "password": "YourSecurePass123"
}

Add an API key

POST /keys
Authorization: Bearer YOUR_JWT
Content-Type: application/json

{
  "vendor": "openai",
  "label": "Personal OpenAI",
  "api_key": "sk-..."
}

Supported vendors: openai, anthropic, google, deepseek, qwen, moonshot, minimax

List your keys

GET /keys
Authorization: Bearer YOUR_JWT

Response: array of your keys with metadata (vendor, label, is_active, created_at). The plaintext key is never returned after the initial add.

Delete a key

DELETE /keys/123
Authorization: Bearer YOUR_JWT

Chat completion

POST /v1/chat/completions
Authorization: Bearer YOUR_JWT
Content-Type: application/json

{
  "model": "gpt-4o-mini",
  "messages": [
    {"role": "user", "content": "Hello!"}
  ],
  "max_tokens": 100
}

Or use the vendor field to auto-select a key:

{
  "vendor": "anthropic",
  "messages": [{"role":"user","content":"Hello!"}]
}

Or force a specific key with the X-Key-Id header:

X-Key-Id: 42

Usage stats

GET /usage
Authorization: Bearer YOUR_JWT

Response: usage breakdown by vendor and model, including success/fail counts.

Error responses

Status Meaning
400 Invalid request body or unknown model
401 Missing/invalid JWT, or invalid email/password
403 Trying to access another user’s key
404 Endpoint not found
409 Email already registered
5xx Upstream provider error or our server error

Available models

  • OpenAI: gpt-4o, gpt-4o-mini, gpt-4-turbo, o1-preview, o1-mini
  • Anthropic: claude-sonnet-4-5, claude-haiku-4, claude-opus-4
  • Google: gemini-2.5-pro, gemini-2.5-flash
  • DeepSeek: deepseek-v4-pro, deepseek-v3
  • Alibaba Qwen: qwen3-max, qwen3-plus
  • Moonshot: kimi-k2
  • MiniMax: minimax-m3, minimax-m2.7

Last updated: 2026-06-06. Back to overview · See pricing

Scroll to Top