Skip to main content
Docs
API Overview

API Overview

The Elyxir API provides OpenAI-compatible endpoints for chat completions, completions, and embeddings.

The Elyxir API is an OpenAI-compatible interface that gives you programmatic access to hundreds of AI models. Use your existing OpenAI SDKs with minimal changes.

Base URL

https://api.elyxir.ai

Endpoints

EndpointMethodDescription
/v1/chat/completionsPOSTChat completions — the main inference endpoint
/v1/responsesPOSTOpenAI Responses API
/v1/modelsGETList the model catalog
/v1/models/{model}GETRetrieve one model
/api/v1/memoryGET/POSTRead and write user and project memory
/api/v1/api-keysGET/POSTProvision API keys programmatically
/api/v1/usageGETUsage and spend statistics

The inference endpoints authenticate with an elyxir_ API key. The /api/v1/* platform endpoints take an OAuth JWT plus an X-Organization-Id header — see Memory for the pattern.

Quick Start

curl -X POST https://api.elyxir.ai/v1/chat/completions \
  -H "Authorization: Bearer elyxir_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o-mini",
    "messages": [
      {"role": "user", "content": "Hello!"}
    ]
  }'

OpenAI SDK Compatibility

Use the official OpenAI SDK with Elyxir:

from openai import OpenAI
 
client = OpenAI(
    api_key="elyxir_your_api_key",
    base_url="https://api.elyxir.ai/v1"
)
 
response = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "Hello!"}]
)
 
print(response.choices[0].message.content)

Authentication

All API requests require a Bearer token in the Authorization header:

Authorization: Bearer elyxir_your_api_key

Get your API key from Studio Settings > API Keys.

Learn more about authentication

Request Format

All requests should:

  • Use POST method
  • Include Content-Type: application/json header
  • Include Authorization: Bearer <token> header
  • Send JSON body with required parameters

Response Format

Successful responses return JSON with the standard OpenAI format:

{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1234567890,
  "model": "gpt-4o-mini",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! How can I help you today?"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 10,
    "completion_tokens": 15,
    "total_tokens": 25
  }
}

Error Responses

Errors return appropriate HTTP status codes with JSON details:

{
  "error": {
    "message": "Invalid API key",
    "type": "authentication_error",
    "code": "invalid_api_key"
  }
}

Learn more about error handling

Rate Limits

Throughput scales with your plan, and each key can carry its own spending cap. See Rate limits for how the spend and throughput ceilings differ and how to handle a 429.

Interactive Documentation

Explore the API interactively at api.elyxir.ai with Swagger UI:

  • Browse endpoints
  • Try requests directly
  • View request/response schemas

API Reference

API Overview | Alvin