Overview Auth Quick Start /v1/prices /v1/history /v1/compare /v1/models /v1/providers Plans Errors

API Reference

The Coaxiom API gives you programmatic access to real-time and historical AI inference prices across 15+ AI providers. All responses are JSON. Authentication uses bearer tokens.

The /v1/prices and /v1/providers endpoints are free — no API key required for up to 100 requests/day.

Authentication

Pass your API key in the Authorization header as a bearer token. Keys are prefixed cxm_ and generated in your dashboard.

Authorization: Bearer cxm_your_api_key_here

For unauthenticated requests (free tier), omit the header. Rate limits apply per IP address.

Keep your API key secret. Never expose it in client-side JavaScript or commit it to version control. Rotate compromised keys immediately from your dashboard.

Base URL

https://coaxiom.io/api/v1/

All endpoints are HTTPS only. HTTP requests will be redirected. The API is stateless — no sessions or cookies.

Quick Start

Query prices for Llama 3.1 70B across providers (coming soon):

curl https://coaxiom.io/api/v1/prices?model=llama-3.1-70b
import requests

res = requests.get(
    "https://coaxiom.io/api/v1/prices",
    params={"model": "llama-3.1-70b"},
    headers={"Authorization": "Bearer cxm_your_key"}  # optional
)
data = res.json()
for p in data["prices"]:
    print(f"{p['provider']:15} ${p['blended_per_1m']:.4f}/1M")
const res = await fetch(
  'https://coaxiom.io/api/v1/prices?model=llama-3.1-70b',
  { headers: { 'Authorization': 'Bearer cxm_your_key' } }
);
const { prices } = await res.json();
prices.forEach(p => console.log(p.provider, p.blended_per_1m));

/v1/prices

GET /api/v1/prices FREE

Returns live AI inference prices across all providers for a given model. This is the core endpoint — the benchmark feed for inference cost intelligence.

Query Parameters

ParameterTypeDescription
modeloptional string Model slug to filter by. If omitted, returns all tracked models. Example: llama-3.1-70b
provideroptional string Filter to a single provider. Example: groq

Example Request

GET /api/v1/prices?model=llama-3.1-70b

Authorization: Bearer cxm_your_key

Example Response

{
  "model": "llama-3.1-70b",
  "updated_at": "2026-05-12T14:32:00Z",
  "prices": [
    {
      "provider":          "groq",
      "input_per_1m":      0.05,
      "output_per_1m":     0.10,
      "blended_per_1m":    0.075,
      "context_window":    131072,
      "status":            "live"
    },
    {
      "provider":          "together",
      "input_per_1m":      0.18,
      "output_per_1m":     0.18,
      "blended_per_1m":    0.18,
      "context_window":    131072,
      "status":            "live"
    }
  ]
}

/v1/history

GET /api/v1/history DEVELOPER+

Returns OHLC (open, high, low, close) price history for a model+provider pair. This is the only time-series AI inference pricing feed in existence — our core data moat.

Query Parameters

ParameterTypeDescription
modelrequired string Model slug. Example: llama-3.1-70b
providerrequired string Provider slug. Example: groq
daysoptional integer Number of days of history. Default: 30. Max: 365 (Team tier).
intervaloptional string Candle interval: 1d (default), 1h (Team+).

Example Request

GET /api/v1/history?model=llama-3.1-70b&provider=groq&days=30

Authorization: Bearer cxm_your_key

Example Response

{
  "model":    "llama-3.1-70b",
  "provider": "groq",
  "interval": "1d",
  "candles": [
    {
      "date":  "2026-04-12",
      "open":  0.075,
      "high":  0.082,
      "low":   0.071,
      "close": 0.075,
      "change_pct": 0.0
    },
    {
      "date":  "2026-04-13",
      "open":  0.075,
      "high":  0.075,
      "low":   0.060,
      "close": 0.060,
      "change_pct": -20.0
    }
  ]
}
Requires Developer plan or higher. Free tier returns 402 Payment Required.

/v1/compare

GET /api/v1/compare TEAM+

Cross-model price comparison. Returns a normalized comparison matrix across up to 5 models simultaneously — useful for cost-optimal model selection in production routing.

Query Parameters

ParameterTypeDescription
modelsrequired string Comma-separated model slugs, max 5. Example: llama-3.1-70b,gpt-4o,claude-3-5-sonnet
provideroptional string Filter to a specific provider across all models.

Example Request

GET /api/v1/compare?models=llama-3.1-70b,gpt-4o,deepseek-v3

Authorization: Bearer cxm_your_key

Example Response

{
  "updated_at": "2026-05-12T14:32:00Z",
  "models": [
    {
      "model":            "llama-3.1-70b",
      "cheapest_provider": "groq",
      "cheapest_blended": 0.075,
      "avg_blended":      0.21,
      "provider_count":   12
    },
    {
      "model":            "gpt-4o",
      "cheapest_provider": "openai",
      "cheapest_blended": 3.75,
      "avg_blended":      4.10,
      "provider_count":   3
    }
  ]
}

/v1/models

GET /api/v1/models FREE

Returns the full catalog of tracked models with metadata. Use this to discover valid slugs for other endpoints.

Example Request

GET /api/v1/models

Example Response

{
  "models": [
    {
      "slug":            "llama-3.1-70b",
      "display_name":    "Llama 3.1 70B",
      "family":          "llama",
      "params_b":        70,
      "context_window":  131072,
      "provider_count":  12,
      "is_benchmark":    true
    },
    {
      "slug":            "deepseek-v3",
      "display_name":    "DeepSeek V3",
      "family":          "deepseek",
      "params_b":        671,
      "context_window":  131072,
      "provider_count":  8,
      "is_benchmark":    false
    }
  ]
}

/v1/providers

GET /api/v1/providers FREE

Returns all tracked inference providers with status and model counts.

Example Request

GET /api/v1/providers

Example Response

{
  "providers": [
    {
      "slug":         "groq",
      "name":         "Groq",
      "model_count":  6,
      "status":       "operational",
      "signup_url":   "https://console.groq.com"
    },
    {
      "slug":         "together",
      "name":         "Together AI",
      "model_count":  14,
      "status":       "operational",
      "signup_url":   "https://api.together.ai"
    }
  ]
}

API Routing Developer+

Coaxiom's routing layer is an OpenAI-compatible endpoint that automatically selects the cheapest live provider for your model. Drop it in as your baseURL and Coaxiom handles the rest.

Your provider keys, your traffic. Coaxiom routes requests using your API keys for each provider — passed via X-Provider-Keys header. This keeps Coaxiom as a neutral routing layer and ensures your traffic operates under your own provider agreements.

Base URL

https://coaxiom.io/api/v1/route

Authentication Headers

HeaderRequiredDescription
AuthorizationYesBearer cxm_your_key — your Coaxiom API key
X-Provider-KeysRecommendedbase64-encoded JSON of your provider API keys (see below)

X-Provider-Keys format

Encode a JSON object mapping provider slugs to your API keys, then base64-encode the result:

// Build the header value:
const providerKeys = {
  together:  "sk-...",
  groq:      "gsk_...",
  fireworks: "fw-...",
  nebius:    "...",
};
const headerValue = btoa(JSON.stringify(providerKeys));
// → pass as: "X-Provider-Keys": headerValue
POST /api/v1/route/chat/completions

OpenAI-compatible chat completions. Routes to cheapest available provider. Falls back to static priority order if price data is unavailable.

// Node.js — native SDK
import { CoaxiomClient } from '@coaxiom/sdk';

const client = new CoaxiomClient({
  apiKey: 'cxm_your_key',
  providerKeys: {
    together:  'sk-...',
    groq:      'gsk_...',
    fireworks: 'fw-...',
  },
});

const res = await client.chat({
  model: 'llama-3.3-70b',
  messages: [{ role: 'user', content: 'Hello' }],
});

console.log(res.choices[0].message.content);
console.log(res._coaxiom); // routing metadata
# Python — native SDK
from coaxiom import CoaxiomClient

client = CoaxiomClient(
    api_key="cxm_your_key",
    provider_keys={
        "together": "sk-...",
        "groq": "gsk_...",
    },
)

res = client.chat(
    model="llama-3.3-70b",
    messages=[{"role": "user", "content": "Hello"}],
)
print(res["choices"][0]["message"]["content"])
print(res["_coaxiom"])  # routing metadata
# OpenAI drop-in (Python)
from coaxiom import CoaxiomClient
client = CoaxiomClient(api_key="cxm_your_key", provider_keys={"groq": "gsk_..."})
openai = client.openai_client()  # returns openai.OpenAI pointing at Coaxiom

res = openai.chat.completions.create(
    model="llama-3.3-70b",
    messages=[{"role": "user", "content": "Hello"}],
)
print(res.choices[0].message.content)

Response — _coaxiom metadata block

Every routing response includes a _coaxiom key alongside the standard OpenAI response fields:

{
  "id": "chatcmpl-...",
  "choices": [...],
  "usage": { "prompt_tokens": 12, "completion_tokens": 48, "total_tokens": 60 },
  "_coaxiom": {
    "provider": "groq",
    "provider_name": "Groq",
    "model_slug": "llama-3.3-70b",
    "provider_model_id": "llama-3.3-70b-versatile",
    "routed_by_price": true,
    "price_per_1m_usd": 0.59,
    "latency_ms": 412,
    "key_source": "customer",
    "version": "1.0"
  }
}

key_source: "customer" confirms your X-Provider-Keys key was used. "platform" indicates Coaxiom's shared key was used (dev/test only).

GET /api/v1/route/models

List all routable models and which providers are configured for each.

GET /api/v1/route/models
Authorization: Bearer cxm_your_key
{
  "models": [
    {
      "slug": "llama-3.3-70b",
      "providers": [
        { "provider": "groq", "model_id": "llama-3.3-70b-versatile", "configured": true },
        { "provider": "together", "model_id": "meta-llama/Llama-3.3-70B-Instruct-Turbo", "configured": false }
      ]
    }
  ],
  "count": 45
}

configured: true reflects Coaxiom's platform keys. Your X-Provider-Keys may unlock additional providers regardless of this field.

Supported provider slugs

Use these slug names as keys in your X-Provider-Keys JSON object:

together groq fireworks deepinfra nebius cerebras mistral sambanova xai hyperbolic novita lambda nvidia perplexity cloudflare digitalocean openai

Install the SDKs

# Python
pip install coaxiom

# Node / TypeScript
npm install @coaxiom/sdk

Plans & Rate Limits

All limits are per rolling 24-hour window (free) or per calendar month (paid tiers). Exceeding limits returns 429 Too Many Requests.

Plan Price Requests /prices /history /compare Webhooks
Free $0 100 / day
Developer $19 / mo 10,000 / mo
Team $79 / mo 100,000 / mo
Enterprise Custom Unlimited
Enterprise includes a Kafka streaming feed and Snowflake connector for real-time data pipeline integration. Contact [email protected].

Error Codes

All errors return JSON with an error field describing what went wrong.

CodeMeaningCommon Cause
400 Bad Request Missing required parameter or invalid value
401 Unauthorized Invalid or missing API key
402 Payment Required Endpoint requires a paid tier
404 Not Found Model or provider slug doesn't exist
429 Too Many Requests Rate limit exceeded. Check Retry-After header
500 Internal Server Error Something broke on our end. Retry with exponential backoff

Error Response Shape

{
  "error": "model not found",
  "code":  404
}

Response Schemas

Price Object

provider string — provider slug (e.g. "groq")
input_per_1m float — USD per 1M input
output_per_1m float — USD per 1M output
blended_per_1m float — 50/50 blended rate (input + output) / 2
context_window integer — max context window in tokens
status string"live" | "stale" | "unavailable"

OHLC Candle Object

date string — ISO date "YYYY-MM-DD"
open float — blended rate at open
high float — highest blended rate in period
low float — lowest blended rate in period
close float — blended rate at close
change_pct float — percent change from previous close

Changelog

v1.1 — May 2026

  • API Routing launched: POST /api/v1/route/chat/completions — OpenAI-compatible, routes to cheapest live provider
  • X-Provider-Keys header: customers supply their own provider credentials — Coaxiom acts as pure routing layer
  • Python SDK (pip install coaxiom) and Node SDK (npm install @coaxiom/sdk) released
  • _coaxiom metadata block in all routing responses: provider, price, latency, key_source
  • Security notification emails: API key created, API key revoked, new device sign-in

v1 — May 2026

  • Initial public API launch
  • Endpoints: /prices, /history, /compare, /models, /providers
  • 15+ providers tracked at launch
  • OHLC history available from index inception date