Quickstart

Send your first request through LineMod

Create a LineMod API key, set the gateway base URL in your OpenAI client, and send a request with an auto:* model alias.
Setup

Before you call the API

Before you start, create a LineMod organization and API key. Use the gateway base URL shown below.
01
Create an account
Register at linemod.ai, verify email, and complete onboarding.
/console
02
Create an API key
Console → API Keys. Keys start with sr_gl_ for the overseas gateway.
sr_gl_...
03
Set the base URL
Set your OpenAI client's base URL to https://api.linemod.ai/v1.
https://api.linemod.ai/v1
04
Pick a model alias
Use auto:balanced for your first request. You can choose another alias or adjust routing rules in Console later.
auto:balanced
Examples

Request examples

All examples use bearer auth and the standard chat completions body.
OpenAI SDK
PythonOpenAI SDK
from openai import OpenAI
import os

client = OpenAI(
  base_url="https://api.linemod.ai/v1",
  api_key=os.environ["LINEMOD_API_KEY"],
)

response = client.chat.completions.create(
  model="auto:balanced",
  messages=[
      {"role": "user", "content": "Summarize this support incident."}
  ],
)
print(response.choices[0].message.content)
Verify

Confirm routing and tracing

After a successful request, log the response headers for the selected model, routing reason, estimated cost, and request ID.
ModelX-LineMod-Model-Used
ReasonX-LineMod-Route-Reason
CostX-LineMod-Cost
TraceX-LineMod-Request-Id
Console playground

Preview routing presets in Console Playground, or copy examples from SDK Snippets.

Next

What to read next

APIHeaders and streaming
RoutingAuto aliases and failover
SecuritySecurity templates and tool access