Start with one request.
The base URL, model ID, and secret key are the only changes your first integration needs.
01 Create a key in your workspace.
02 Add at least $5 in USD credits.
03 Choose an available model and send a small request.
export LEXELANE_API_KEY="your-secret-key"
# Keep this secret on your server.from openai import OpenAI
import os
client = OpenAI(
base_url="https://lexelane.com/v1",
api_key=os.environ["LEXELANE_API_KEY"],
)
response = client.chat.completions.create(
model="deepseek/deepseek-v4.1-flash",
messages=[{"role": "user", "content": "Hello, Lexelane."}],
max_tokens=256,
)
print(response.choices[0].message.content)Available model IDs are returned by GET /v1/models with your API key. Coming-soon catalog entries cannot be called yet.
A key per application.
Sign in with an operator-provisioned email/password account, or Google when enabled. Password signup is not public. After signing in, Account settings lets you rotate your password; application API keys are created and revoked separately.
Use Authorization: Bearer with your secret key. The full secret is displayed once; the server stores its hash. Set a lifetime spending budget and expiry for each key, and revoke old keys from the workspace.
curl "https://lexelane.com/v1/models" \
-H "Authorization: Bearer $LEXELANE_API_KEY"Never embed secrets in browser bundles, URLs, screenshots, or a public repository.
Streaming & tool calls
Chat Completions uses server-sent events. Ask for final usage so the request can be accurately reconciled. Tool definitions and results use the selected model’s native schema; your application executes client-side tools.
stream = client.chat.completions.create(
model="deepseek/deepseek-v4.1-flash",
messages=[{"role": "user", "content": "Hello"}],
max_tokens=256,
stream=True,
stream_options={"include_usage": True},
)
for chunk in stream:
if chunk.choices:
print(chunk.choices[0].delta.content or "", end="")One service. Your existing tools.
Codex CLI
Use a model supporting the native Responses API. Add a custom provider to ~/.codex/config.toml.
model = "your-responses-model-id"
model_provider = "lexelane"
[model_providers.lexelane]
name = "Lexelane"
base_url = "https://lexelane.com/v1"
env_key = "LEXELANE_API_KEY"
wire_api = "responses"
requires_openai_auth = false
supports_websockets = falseClaude Code
Select an available Claude model with Messages, streaming, and tool support. The base URL omits /v1. Start with prompt caching disabled until the route has verified cache billing.
export ANTHROPIC_BASE_URL="https://lexelane.com"
export ANTHROPIC_AUTH_TOKEN="$LEXELANE_API_KEY"
export ANTHROPIC_MODEL="your-messages-model-id"
export DISABLE_PROMPT_CACHING="1"
claudeCLI · MCP · Skill
Download the client kitDownload and extract the kit, then run npm install inside it. The companion tools expose model discovery, balance checks, and text generation. MCP chat is a paid API action; checking models or balance does not generate tokens.
export LEXELANE_BASE_URL="https://lexelane.com"
node packages/cli/src/cli.mjs models
node packages/cli/src/cli.mjs balance
node packages/cli/src/cli.mjs chat "deepseek/deepseek-v4.1-flash" "Hello"{
"mcpServers": {
"lexelane": {
"command": "node",
"args": ["/absolute/path/to/lexelane-client-kit/packages/mcp/src/server.mjs"],
"env": {
"LEXELANE_BASE_URL": "https://lexelane.com",
"LEXELANE_API_KEY": "your-secret-key"
}
}
}
}Install the included skills/lexelane folder in your client’s skills directory. Store MCP credentials in private local configuration. MCP tools do not switch the host assistant’s inference model.
Predictable limits. Traceable requests.
Requests reserve a conservative budget before generation, then settle against confirmed usage. Missing final usage is flagged for review and may temporarily charge the reserved ceiling; confirmed overcharges are refunded through the ledger. Default account limits are 60 requests per minute and 5 concurrent calls; your workspace shows your actual limits.
| HTTP status | Meaning & action |
|---|---|
| 401 | Check the API key or create a new one. |
| 402 | Add balance or adjust the key budget. |
| 400 | Review request fields and model protocol. |
| 429 | Rate or concurrency limit: retry with backoff. |
| 503 | The model is not available yet. |
| 502 / 504 | Service error: review Usage before retrying. |
Keep the x-request-id response header when contacting support.
Good questions. Clear answers.
How should I compare prices?+
Compare input and output rates for the same model version using your own token mix. Caching, context length, service tiers, and quantization can affect comparability. Comparison pages label the date, conditions, and public market sources.
Can I use OpenAI SDKs, Codex, and Claude Code?+
The gateway provides native API interfaces. OpenAI SDKs commonly use Chat Completions, Codex needs Responses, and Claude Code needs Messages. Choose an available model with the required protocol; support for one interface does not establish compatibility with every client.
How are API keys protected?+
Full secrets are shown once at creation; the server stores hashes. Create separate keys per application, set budgets and expiry dates, and revoke access when needed. Keep keys in server environment variables.
Do you store my prompts?+
The usage database does not store prompts or generated text. It records request, token, and billing metadata. Content is processed by model service providers under their data policies. Review the privacy policy before submitting sensitive information.