Quickstart

Make your first Modellane API call: base URL, API key and model parameters, then a chat completion request in curl, Python and Node.js.

The Modellane API is compatible with the OpenAI Chat Completions format, and also serves the OpenAI Responses and Anthropic Messages formats. Point an existing SDK at the Modellane base URL, use a key from your dashboard, and your code keeps working.

The API speaks the OpenAI Chat Completions format, so any OpenAI SDK or tool that lets you set a base URL works without code changes. You need three values:

  1. Get an API key: Create one in the console and keep it in an environment variable.
  2. Set the base URL: Point your SDK at the Modellane endpoint; the table below lists the values.
  3. Send a request: Call the chat API in curl, Python or Node.js.
ParamValue
base_urlhttps://usemodellane.com/v1
api_keyA key from API keys in your dashboard
modellane-1 (see Models & pricing for every model)

The same key and models also work in two more request formats. Use the one your SDK or tool speaks; prices and limits are the same in all three.

FormatBase URLEndpoint
OpenAI Chat Completions (default)https://usemodellane.com/v1POST /v1/chat/completions
OpenAI Responseshttps://usemodellane.com/v1POST /v1/responses
Anthropic Messageshttps://usemodellane.comPOST /v1/messages

The Anthropic SDKs add /v1 themselves, so their base URL has no /v1 at the end. See the Anthropic Messages API and Responses API guides for what each format supports.

Coding agents, chat apps and agent frameworks need the same values. Integrations has ready-made settings for Codex, Claude Code, Cline, the OpenAI and Anthropic SDKs, LangChain and more.

Invoke the chat API#

Once you have a key, send a chat completion request. The examples below use the official OpenAI SDKs with only the base URL and key changed. Each one sends a system and a user message and prints the reply.

curl

curl https://usemodellane.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $MODELLANE_API_KEY" \
  -d '{
    "model": "lane-1",
    "messages": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "Hello!"}
    ],
    "stream": false
  }'

Python

# pip install openai
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["MODELLANE_API_KEY"],
    base_url="https://usemodellane.com/v1",
)

response = client.chat.completions.create(
    model="lane-1",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Hello!"},
    ],
    stream=False,
)

print(response.choices[0].message.content)

Node.js

// npm install openai
import OpenAI from "openai"

const client = new OpenAI({
  apiKey: process.env.MODELLANE_API_KEY,
  baseURL: "https://usemodellane.com/v1",
})

const response = await client.chat.completions.create({
  model: "lane-1",
  messages: [
    { role: "system", content: "You are a helpful assistant." },
    { role: "user", content: "Hello!" },
  ],
  stream: false,
})

console.log(response.choices[0].message.content)

Stream the reply#

The examples return the whole reply at once. Set stream to true to receive it token by token as server-sent events instead; the SDKs then return an iterator. Add stream_options: {"include_usage": true} to get the token usage in a final chunk before the done marker. The Streaming responses guide covers the event format.

Next steps#