Create a key
In your profile, API tab. The key starts with sk-slafy- and is shown once, so save it.
Chat Completions, Responses, Images and Messages on one key. This page has addresses, models, endpoints and errors; setup for Cursor, Claude Code, Codex and other IDEs is under Integrations.
In your profile, API tab. The key starts with sk-slafy- and is shown once, so save it.
For the OpenAI format the address is https://slafy.co/v1, for Anthropic https://slafy.co. Pass the key as Bearer or x-api-key.
https://slafy.co/v1https://slafy.co, the SDK adds /v1 itselfAuthorization: Bearer sk-slafy-… or x-api-key: sk-slafy-… headerGET /v1/models, prices on the Pricing pagereasoning_effort (reasoning.effort in Responses): low, medium, high, xhigh, max or ultra, the last one being the maximum for the selected model. If a model doesn't support a value, Slafy substitutes the closest one, and for models without effort settings it removes the parameterPython and Node.js, any model via Chat Completions
from openai import OpenAI
client = OpenAI(base_url="https://slafy.co/v1", api_key="sk-slafy-your_key")
r = client.chat.completions.create(
model="claude-sonnet-5-5",
messages=[{"role": "user", "content": "Hello"}],
)
print(r.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://slafy.co/v1", apiKey: process.env.SLAFY_API_KEY });
const r = await client.chat.completions.create({
model: "gpt-6-luna",
messages: [{ role: "user", content: "Hello" }],
});
console.log(r.choices[0].message.content);Python and Node.js, Claude models via Messages
import anthropic
client = anthropic.Anthropic(base_url="https://slafy.co", api_key="sk-slafy-your_key")
m = client.messages.create(
model="claude-sonnet-5-5",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello"}],
)
print(m.content[0].text)import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({ baseURL: "https://slafy.co", apiKey: process.env.SLAFY_API_KEY });
const m = await client.messages.create({
model: "claude-sonnet-5-5",
max_tokens: 1024,
messages: [{ role: "user", content: "Hello" }],
});
console.log(m.content[0].text);Check your key and model from the terminal
curl https://slafy.co/v1/chat/completions \
-H "Authorization: Bearer sk-slafy-your_key" \
-H "Content-Type: application/json" \
-d '{"model": "claude-sonnet-5-5", "messages": [{"role": "user", "content": "Hello"}]}'curl https://slafy.co/v1/messages \
-H "x-api-key: sk-slafy-your_key" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{"model": "claude-sonnet-5-5", "max_tokens": 512, "stream": true,
"messages": [{"role": "user", "content": "Tell me a joke"}]}'The model draws inside its answer or through the Images API
One image costs $0.199, which is 500,000 balance tokens. Errors and rejected requests are free.
Add the {"type": "image_generation"} tool to a Responses request. The model decides when to draw and returns the image in an image_generation_call item (base64 PNG in the result field). This is how Codex and agents built on the OpenAI SDK draw.
curl https://slafy.co/v1/responses \
-H "Authorization: Bearer sk-slafy-your_key" \
-H "Content-Type: application/json" \
-d '{"model": "gpt-6-astra", "input": "Draw an app icon: a blue whale, flat style",
"tools": [{"type": "image_generation", "quality": "low"}]}'GPT models can draw: gpt-6.1-sol, gpt-6.1-terra, gpt-6-astra, gpt-6-luna. The text tokens of the answer are added to the image price.
from openai import OpenAI
import base64
client = OpenAI(base_url="https://slafy.co/v1", api_key="sk-slafy-your_key")
r = client.images.generate(model="gpt-image-2.5-sunburst", prompt="A blue whale, flat style", size="1024x1024")
open("whale.png", "wb").write(base64.b64decode(r.data[0].b64_json))The names gpt-image-2, gpt-image-1, dall-e-3 work too: Slafy sends them to gpt-image-2.5-sunburst. So ready-made scripts and skills written for OpenAI work without changes.
IDs for the model field and the API formats each model works with. Prices are on the pricing page.
claude-opus-5-5chat/completions · responses · messagesclaude-sonnet-5-5chat/completions · responses · messagesclaude-haiku-5-5chat/completions · responses · messagesclaude-fable-5-1chat/completions · responses · messagesgpt-6.1-solchat/completions · responses · messagesgpt-6.1-terrachat/completions · responsesgpt-6-astrachat/completions · responses · messagesgpt-6-lunachat/completions · responses · messagesgpt-image-2.5-sunburstimagesgemini-4-argonchat/completionsgemini-3.8-flashchat/completionsgrok-4.7chat/completions · responses · messagesdeepseek-v4-prochat/completionsdeepseek-v4.1-flash-1017chat/completionskimi-k3.1-prochat/completionsglm-5.3chat/completions · responses · messagesglm-5.3-flashchat/completions · responses · messages| Method and path | Format |
|---|---|
POST /v1/chat/completions | OpenAI Chat Completions, streaming supported |
POST /v1/responses | OpenAI Responses, streaming and the image_generation tool |
POST /v1/messages | Anthropic Messages, streaming supported |
POST /v1/messages/count_tokens | Anthropic, token counting, free |
POST /v1/images/generations | OpenAI Images, response in b64_json |
POST /v1/images/edits | OpenAI Images, multipart/form-data |
GET /v1/models | List of available models |
Which model works with which endpoint is shown in pricing.
| HTTP | Code | What to do |
|---|---|---|
| 401 | invalid_api_key | Key not found or disabled. Copy the full key from your profile. |
| 402 | insufficient_balance | You're out of tokens, top up your balance. |
| 402 | key_limit_reached | The key has hit its spending limit, raise the limit in the API tab. |
| 404 | model_not_found | No such model. Check the name with GET /v1/models. |
| 429 | rate_limit_exceeded | Too many requests. Try again in a few seconds. |
| 5xx | upstream_error | Model-side failure, the request isn't charged. Try again. |
Every response has a x-request-id header that you can use to find the request in your history.