API reference
Inferlane exposes an OpenAI-compatible HTTP API. If your code already talks to OpenAI, switch the base URL and API key and it talks to Inferlane.
Overview
- Base URL:
https://inferlane/v1 - Authentication: bearer token (your API key) on
/v1/chat/completions - Formats: JSON requests, JSON or
text/event-streamresponses - Compatible with the official OpenAI SDKs for Python and Node.js
Authentication
Create an account on the registration page; an API key is generated immediately and
shown in your dashboard. Keys look like sk-qrd-… followed by 48 hex characters.
Send the key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
You can rotate the key from the dashboard at any time; the previous key stops working instantly.
Base URL & SDK setup
from openai import OpenAI
client = OpenAI(
base_url="https://inferlane/v1",
api_key="YOUR_API_KEY",
)
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://inferlane/v1",
apiKey: "YOUR_API_KEY",
});
List models
Returns every model currently available. This endpoint does not require an API key, so you can open it directly: /v1/models.
Query parameters
| Name | Type | Description |
|---|---|---|
type | string | Only return models of this type, e.g. chat. |
provider | string | Only return models served by the given upstream provider. |
for model in client.models.list().data:
print(model.id)
const models = await client.models.list();
for (const m of models.data) console.log(m.id);
curl https://inferlane/v1/models
Response
{
"object": "list",
"data": [
{ "id": "openai/gpt-oss-120b", "object": "model", "type": "chat" }
]
}
Chat completions
Generates a model response for a conversation. Requires an API key. Any chat model ID from
/v1/models is accepted.
Request body
| Field | Type | Description |
|---|---|---|
model | string, required | Model ID, e.g. openai/gpt-oss-120b. |
messages | array, required | Conversation as { role, content } objects. Roles: system, user, assistant, tool. |
stream | boolean | When true, the response is streamed as server-sent events. |
n | integer | Number of completions to generate. Defaults to 1. |
temperature, max_tokens, top_p, tools, … | various | Standard OpenAI parameters are forwarded to the model where supported. |
provider | string | Optional. Pin the request to a specific upstream provider listed for the model; otherwise one is chosen automatically. |
response = client.chat.completions.create(
model="openai/gpt-oss-120b",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello! How are you today?"},
],
)
print(response.choices[0].message.content)
const response = await client.chat.completions.create({
model: "openai/gpt-oss-120b",
messages: [
{ role: "system", content: "You are a helpful assistant." },
{ role: "user", content: "Hello! How are you today?" },
],
});
console.log(response.choices[0].message.content);
curl https://inferlane/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-oss-120b",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello! How are you today?"}
]
}'
Response
{
"id": "chatcmpl-…",
"object": "chat.completion",
"created": 1710000000,
"model": "openai/gpt-oss-120b",
"choices": [
{
"index": 0,
"message": { "role": "assistant", "content": "Hello! I'm doing well…" },
"finish_reason": "stop"
}
],
"usage": { "prompt_tokens": 23, "completion_tokens": 12, "total_tokens": 35 }
}
Streaming
Set "stream": true to receive text/event-stream chunks in the OpenAI
chat.completion.chunk format, terminated by data: [DONE].
stream = client.chat.completions.create(
model="openai/gpt-oss-120b",
messages=[{"role": "user", "content": "Write a haiku about lanes."}],
stream=True,
)
for chunk in stream:
delta = chunk.choices[0].delta.content
if delta:
print(delta, end="", flush=True)
const stream = await client.chat.completions.create({
model: "openai/gpt-oss-120b",
messages: [{ role: "user", content: "Write a haiku about lanes." }],
stream: true,
});
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}
Errors
Errors follow the OpenAI envelope: { "error": { "message", "type", "code" } }.
| Status | Code | Meaning |
|---|---|---|
400 | — | Missing model/messages, or the model is not a chat model. |
401 | invalid_api_key | No bearer token, or the key is malformed. |
403 | invalid_api_key / expired_api_key | The key is unknown (rotated or deleted) or expired. Get the current one from your dashboard. |
404 | — | Unknown model ID. Check /v1/models. |
500 | internal_error | Upstream failure after retries. Retry the request. |
Data & training
Inferlane is free because the requests flowing through it are valuable as training data. Concretely:
the prompts you send and the completions you receive through /v1/chat/completions are used for AI training.
- Every model is free, for every account, with no tiers.
- Assume anything you send may be learned by a future model.
- Do not send secrets, personal data or anything under a confidentiality obligation.
- Your account holds only a username, a salted password hash and your API key. There are no usage statistics.
