CONNECT YOUR CLIENT
Your first request.
Create an account, verify your email, then issue an API key. Store it in RUNLANE_API_KEY. The examples below use the current service endpoint.
from openai import OpenAI
import os
client = OpenAI(
base_url="http://localhost:3080/v1",
api_key=os.environ["RUNLANE_API_KEY"],
)
stream = client.chat.completions.create(
model="YOUR_MODEL_ID",
messages=[{"role": "user",
"content": "Explain this code."}],
max_tokens=2048,
stream=True,
)
for chunk in stream:
if chunk.choices:
print(chunk.choices[0].delta.content or "",
end="", flush=True)For Claude Code, the Anthropic base URL has no /v1 suffix. Select the Qwen model explicitly. Tool availability and reasoning behavior differ from Claude.
Supported API surface
| Endpoint | Supported behavior |
|---|---|
GET /v1/models | Discover the model and context limits. |
POST /v1/chat/completions | Text, function tools, JSON output, SSE, usage. |
POST /v1/messages | Native Anthropic text/function tools and SSE. |
POST /v1/messages/count_tokens | Token count for a formatted Messages request. |
POST /v1/responses | Stateless text and caller-executed function tools. Send store: false. |
Stored Responses, previous_response_id, background jobs, hosted tools, files, media URLs and image inputs are not supported in this preview. Streaming tool calls are returned to your client; Runlane never executes the tools.
Plan for shared capacity
One in-flight request per workspace, including queued requests. All keys share the same limit. Up to six starts per rolling minute; prompts above 32,768 input tokens are limited to six per rolling hour.
Context is checked with the model’s tokenizer before generation. Input plus maximum output must fit 262,144 tokens. Output is capped at 32,768 tokens. A request can queue for up to 45 seconds and has a 15-minute overall deadline.
429 Too Many Requests
Retry-After: 5
x-request-id: …
Wait at least Retry-After seconds.
Then retry with exponential backoff + random jitter.Do not open extra API keys to bypass limits. When a client disconnects, its upstream request is canceled. Retry interrupted generations deliberately: a retry is a new generation.
Reasoning and function tools
Reasoning is off by default to keep short requests predictable. With OpenAI clients, pass extra_body={"chat_template_kwargs":{"enable_thinking":true}}. With Anthropic clients, use the thinking option. Reasoning consumes the output allowance. For this Qwen model, high maps to medium and max maps to xhigh. Native Messages does not enforce a separate budget_tokens; use adaptive/on-off thinking and max_tokens.
Provide ordinary function schemas, inspect returned tool calls, execute authorized actions in your own client, and return tool results. API compatibility does not guarantee that every agent workflow succeeds; evaluate your actual tasks.
Inspect metadata, keep content local
The console records status, model, timestamps, token counts, queue time and duration. Runlane’s application database does not store prompt or completion bodies. Your client and the model host may have their own retention settings.
Incomplete streams can lack final token usage. These are marked incomplete rather than zero. x-request-id identifies a request when investigating a failure.