API Reference

Apollohub provides an OpenAI-compatible API. Use any OpenAI SDK with your Apollohub key.

Base URL
https://apollohub.me/

Authentication

OpenAI-compatible clients use bearer authentication. Include your API key in the Authorization header:

Authorization: Bearer sk-ah-YOUR_API_KEY

Anthropic-compatible clients can send the same key in the x-api-key header:

x-api-key: sk-ah-YOUR_API_KEY

Keep your API key secure. Never expose it in client-side code or public repositories. Load it from environment variables or a secure key store.

Quickstart

1. Get your API key

Go to API keys and create a key. It starts with sk-ah- and is shown only once. Save it immediately.

2. Make your first request

Use the chat completions endpoint to send messages to any supported model:

curl
export APOLLOHUB_API_KEY="sk-ah-YOUR_KEY" curl https://apollohub.me/v1/chat/completions \ -H "Authorization: Bearer $APOLLOHUB_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-5.6-luna", "messages": [{"role": "user", "content": "What is the capital of France?"}] }'
Python
import os from openai import OpenAI client = OpenAI( api_key=os.environ["APOLLOHUB_API_KEY"], base_url="https://apollohub.me/v1", ) response = client.chat.completions.create( model="gpt-5.6-luna", messages=[{"role": "user", "content": "What is the capital of France?"}], ) print(response.choices[0].message.content)
Node.js
import OpenAI from 'openai' const client = new OpenAI({ apiKey: process.env.APOLLOHUB_API_KEY, baseURL: 'https://apollohub.me/v1', }) const response = await client.chat.completions.create({ model: 'gpt-5.6-luna', messages: [{ role: 'user', content: 'What is the capital of France?' }], }) console.log(response.choices[0].message.content)

Endpoints

OpenAI-compatible clients should use https://apollohub.me/v1 as their base URL.

  • POST /v1/chat/completions for chat completions
  • POST /v1/responses for the Responses API
  • POST /v1/messages for Anthropic-compatible messages
  • GET /v1/models for the live model catalog

Streaming

Enable streaming by setting stream: true in your request. The API will return server-sent events as the model generates tokens.

curl
curl https://apollohub.me/v1/chat/completions \ -H "Authorization: Bearer $APOLLOHUB_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-5.6-luna", "stream": true, "messages": [{"role": "user", "content": "Count to 10"}] }'
Python
stream = client.chat.completions.create( model="gpt-5.6-luna", messages=[{"role": "user", "content": "Count to 10"}], stream=True, ) for chunk in stream: if chunk.choices[0].delta.content: print(chunk.choices[0].delta.content, end="")

Models

Model availability can change. View the live catalog with pricing on the Models page, or request it from the API:

curl
curl https://apollohub.me/v1/models \ -H "Authorization: Bearer $APOLLOHUB_API_KEY"

Use a model ID exactly as returned, for example gpt-5.6-luna or deepseek-v4-flash.

Billing

Apollohub bills by token usage. Input and output tokens are priced separately per model. Check your balance and add funds from the Dashboard.

Usage is deducted after each successful metered response. Requests made without a positive balance return a 402 error.

Error Codes

CodeMeaning
400Bad request: invalid JSON, missing fields, or unavailable model
401Missing, invalid, disabled, or expired API key
402Insufficient balance: top up your account to continue
429Rate limit exceeded: reduce your request rate
500Unexpected server error: try again later
502Upstream model provider error: try again later