Docs
Client Libraries
Client Libraries
Use any OpenAI client library against the Elyxir API.
There is no separate Elyxir SDK to install. The API is OpenAI-compatible, so you use your language's official OpenAI client and change two things: the base URL and the key.
JavaScript / TypeScript
Bun
bun add openainpm / Node.js
npm install openaiUsage
import OpenAI from "openai";
const client = new OpenAI({
apiKey: "your-elyxir-api-key",
baseURL: "https://api.elyxir.ai/v1",
});
const response = await client.chat.completions.create({
model: "gpt-4o-mini",
messages: [{ role: "user", content: "Hello!" }],
});
console.log(response.choices[0].message.content);Python
pip install openaiUsage
from openai import OpenAI
client = OpenAI(
api_key="your-elyxir-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)Getting Your API Key
- Go to Settings > API Keys in Studio
- Click Create Key
- Copy the key and store it securely — it is shown once
Or provision one programmatically with the API keys endpoint.
What carries over from OpenAI, and what doesn't
Chat completions, streaming, tool calling, vision and the Responses API all behave as they do against OpenAI. Two things differ:
- No
/v1/completionsor/v1/embeddings. The legacy completions helpers in the OpenAI SDKs will not work. Use chat completions instead. - Model IDs are ours. Pass any model from
GET /v1/models— including models from Anthropic, Google and others — orelyxir-alvinto let Alvin route.
Related
- Authentication - API key setup
- Quickstart - First API call
- Supported Models - Available models