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
| Endpoint | Method | Description |
|---|---|---|
/v1/chat/completions | POST | Chat completions — the main inference endpoint |
/v1/responses | POST | OpenAI Responses API |
/v1/models | GET | List the model catalog |
/v1/models/{model} | GET | Retrieve one model |
/api/v1/memory | GET/POST | Read and write user and project memory |
/api/v1/api-keys | GET/POST | Provision API keys programmatically |
/api/v1/usage | GET | Usage 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.
There is no /v1/completions or /v1/embeddings endpoint on api.elyxir.ai. Use /v1/chat/completions — the OpenAI SDKs' legacy completions helpers will not work against this host.
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
POSTmethod - Include
Content-Type: application/jsonheader - 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