ai-keys

API

Connecting to ai-keys

ai-keys is compatible with the OpenAI API and the Anthropic API. In your client you only change the base URL and the key — your code and libraries stay the same.

Quick start

  1. Account and balance. Sign up and top up your balance with crypto. Keys can’t be issued while the balance is zero.
  2. Key. In the dashboard, open Keys and issue a key. It starts with aik_sk_ and is shown only once.
  3. Client. Set the API base URL and key in your client, then pick a model by its ID from the table below.

Base URL and key

OpenAI-compatible clientshttps://ai-keys.online/v1
Anthropic SDK and Claude Codehttps://ai-keys.online
Auth headerAuthorization: Bearer aik_sk_… or x-api-key: aik_sk_…
EndpointsPOST /v1/chat/completions POST /v1/messages GET /v1/models

Keep the key on your server or in an environment variable; never put it in code your users can see.

Examples

cURL
curl https://ai-keys.online/v1/chat/completions \
  -H "Authorization: Bearer $AI_KEYS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'
Python · openai
from openai import OpenAI

client = OpenAI(
    base_url="https://ai-keys.online/v1",
    api_key="aik_sk_...",
)

reply = client.chat.completions.create(
    model="gpt",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(reply.choices[0].message.content)
JavaScript · openai
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://ai-keys.online/v1",
  apiKey: process.env.AI_KEYS_API_KEY,
});

const reply = await client.chat.completions.create({
  model: "gemini-pro",
  messages: [{ role: "user", content: "Hello!" }],
});
console.log(reply.choices[0].message.content);
Python · anthropic
import anthropic

client = anthropic.Anthropic(
    base_url="https://ai-keys.online",
    api_key="aik_sk_...",
)

message = client.messages.create(
    model="claude-opus",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello!"}],
)
print(message.content[0].text)

Clients

Claude Code

Set these environment variables before launching:

Claude Code
export ANTHROPIC_BASE_URL="https://ai-keys.online"
export ANTHROPIC_AUTH_TOKEN="aik_sk_..."
export ANTHROPIC_MODEL="claude-sonnet"
claude

Cursor, Cherry Studio, LibreChat, Open WebUI

In settings, add a provider of type “OpenAI-compatible” / “Custom OpenAI”:

Base URLhttps://ai-keys.online/v1
API keyaik_sk_…
Modelclaude-sonnet, gpt, gemini-pro …

Models

Pass the ID from the first column in the model field. Prices are per 1M tokens and are charged to your balance.

IDModelContextInputOutput
claude-sonnet Claude Sonnet
Anthropic · Writing, code and document analysis
200k $3.0 $15
claude-opus Claude Opus
Anthropic · Hard problems and long reasoning
200k $15 $75
gpt GPT
OpenAI · All-round model for products
128k $5.0 $15
gpt-mini GPT mini
OpenAI · Short answers and drafts
128k $0.40 $1.6
gemini-pro Gemini Pro
Google · Long context and mixed input
1M $2.5 $10
gemini-flash Gemini Flash
Google · High throughput and classification
1M $0.30 $1.2
grok Grok
xAI · Code, agents and tools
128k $3.0 $15
deepseek DeepSeek
DeepSeek · Reasoning and math
128k $0.50 $2.0
llama Llama
Meta · Open model for your own use cases
128k $0.20 $0.20
List models
curl https://ai-keys.online/v1/models

Errors

HTTPcodeMeaning
401missing_keyNo key in the request headers.
401invalid_keyKey not found or revoked.
402balance_zeroZero balance — top up your account.
404unknown_endpointWrong path. Check the base URL.