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.

The deal: every model is free. The only cost is that the data you send — prompts and completions — is used for AI training. Do not send confidential or personal data.

Overview

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:

HTTP 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",
)

List models

GET /v1/models

Returns every model currently available. This endpoint does not require an API key, so you can open it directly: /v1/models.

Query parameters

NameTypeDescription
typestringOnly return models of this type, e.g. chat.
providerstringOnly return models served by the given upstream provider.
for model in client.models.list().data:
    print(model.id)

Response

200 OK
{
  "object": "list",
  "data": [
    { "id": "openai/gpt-oss-120b", "object": "model", "type": "chat" }
  ]
}

Chat completions

POST /v1/chat/completions

Generates a model response for a conversation. Requires an API key. Any chat model ID from /v1/models is accepted.

Request body

FieldTypeDescription
modelstring, requiredModel ID, e.g. openai/gpt-oss-120b.
messagesarray, requiredConversation as { role, content } objects. Roles: system, user, assistant, tool.
streambooleanWhen true, the response is streamed as server-sent events.
nintegerNumber of completions to generate. Defaults to 1.
temperature, max_tokens, top_p, tools, …variousStandard OpenAI parameters are forwarded to the model where supported.
providerstringOptional. 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)

Response

200 OK
{
  "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)

Errors

Errors follow the OpenAI envelope: { "error": { "message", "type", "code" } }.

StatusCodeMeaning
400—Missing model/messages, or the model is not a chat model.
401invalid_api_keyNo bearer token, or the key is malformed.
403invalid_api_key / expired_api_keyThe key is unknown (rotated or deleted) or expired. Get the current one from your dashboard.
404—Unknown model ID. Check /v1/models.
500internal_errorUpstream 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.