v4.1.0Home

API overview

The Foxora gateway is a single HTTP API that routes requests to whichever model you choose. It speaks the same shape as OpenAI's chat completions endpoint, with extra Foxora-specific routes for account, usage, and models.

Base URL

http
https: //api.foxora.ai/v1

Every endpoint described in these docs is relative to that base URL. We version with a leading /v1; breaking changes get a new path segment.

Conventions

  • Requests and responses are JSON. Set Content-Type: application/json.
  • Authentication is via Authorization: Bearer <token>. See Authentication.
  • All timestamps are ISO 8601 in UTC.
  • IDs are opaque strings — don’t parse them.

Errors

Errors return a non-2xx status with a JSON body of the form:

json
{
  "error": {
    "code": "invalid_request",
    "message": "The 'model' field is required.",
    "param": "model"
  }
}

Common status codes

  • 400 — malformed request body or missing fields.
  • 401 — missing or invalid auth token.
  • 402 — spend limit reached or no payment method on file.
  • 403 — the token is valid but not allowed to perform this action.
  • 404 — resource (model, agent, key) doesn’t exist.
  • 429 — rate-limited. Back off and retry.
  • 5xx — gateway or upstream provider error. Retry with exponential backoff.

Rate limits

Limits are per account, not per key. Default ceilings:

PlanRequests / minTokens / min
Free3040,000
Pro300400,000
Team1,5002,000,000

When you hit a limit you’ll get a 429 with a Retry-After header (seconds).

SDKs

Because the chat completions surface is OpenAI-compatible, you can point the official OpenAI SDK at Foxora by overriding baseURL:

javascript
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.FOXORA_API_KEY,
  baseURL: "https://api.foxora.ai/v1",
});
python
pip install openai

# in your code:
# from openai import OpenAI
# client = OpenAI(api_key=os.environ["FOXORA_API_KEY"],
#                 base_url="https://api.foxora.ai/v1")

Migrating from OpenAI?

In most cases you only need to change two environment variables: OPENAI_API_KEY → your Foxora key, and OPENAI_BASE_URLhttps://api.foxora.ai/v1.