astralane

Astralane / Developers

Integrations

Point an OpenAI-compatible client at the Astralane base URL and send a Astralane API key. Your messages, tools, streaming, and response handling stay where they are. Compatibility covers the implemented request fields, not an untested blanket promise.

OpenAI SDK for JavaScript

The supplied local integration suite covers OpenAI JavaScript chat streaming and non-streaming with mock supply. Other SDK methods and real model routes need separate verification.

Example
import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: process.env.ASTRALANE_API_KEY,
  baseURL: 'https://api.astralane.ai/v1',
});

const result = await client.chat.completions.create({
  model: 'openai/gpt-5.6-sol',
  messages: [{ role: 'user', content: 'Hello, world.' }],
});
console.log(result.choices[0]?.message.content);

OpenAI SDK for Python

Unverified Python configuration example. Check the supported endpoint schemas and run your own client-version smoke tests.

Example
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ['ASTRALANE_API_KEY'],
    base_url='https://api.astralane.ai/v1',
)

response = client.chat.completions.create(
    model='openai/gpt-5.6-sol',
    messages=[{'role': 'user', 'content': 'Hello, world.'}],
)
print(response.choices[0].message.content)

Vercel AI SDK

Build a provider with createOpenAI and hand the model id to generateText or streamText.

Example
import { createOpenAI } from '@ai-sdk/openai';
import { generateText } from 'ai';

const astralane = createOpenAI({
  baseURL: 'https://api.astralane.ai/v1',
  apiKey: process.env.ASTRALANE_API_KEY,
});

const { text } = await generateText({
  model: astralane('openai/gpt-5.6-sol'),
  prompt: 'Hello, world.',
});

LangChain

Unverified configuration example. This does not establish that chains, agents or callbacks are supported.

Example
import os
from langchain_openai import ChatOpenAI

llm = ChatOpenAI(
    model='openai/gpt-5.6-sol',
    base_url='https://api.astralane.ai/v1',
    api_key=os.environ['ASTRALANE_API_KEY'],
)
print(llm.invoke('Hello, world.').content)

Codex CLI

Add a provider block to ~/.codex/config.toml and select it. env_key names the environment variable Codex reads the key from. Codex calls the Responses API. Astralane implements a text-only Responses subset, so a configuration snippet is not evidence that even a plain Codex turn works. Full agent workflows are not verified; stored responses, images and hosted tools are rejected.

Example
# ~/.codex/config.toml
model_provider = "astralane"
model = "openai/gpt-5.6-sol"

[model_providers.astralane]
name = "Astralane"
base_url = "https://api.astralane.ai/v1"
env_key = "ASTRALANE_API_KEY"
wire_api = "responses"

Claude Code

Claude Code reads the Anthropic base URL and token from the environment. Give it the gateway origin without /v1: the client appends /v1/messages itself. Astralane serves /v1/messages as a text-only subset. Tool use, images, and thinking controls are rejected, and neither chat nor agent workflows have been verified with Claude Code. Do not present this example as compatibility certification.

Example
export ANTHROPIC_BASE_URL="https://api.astralane.ai"
export ANTHROPIC_AUTH_TOKEN="$ASTRALANE_API_KEY"
export ANTHROPIC_MODEL="anthropic/claude-sonnet-5"

claude

Cursor

Open Settings, then Models. Paste the key into the OpenAI API key field, switch on Override base URL, and add the model id as a custom model so Cursor sends it verbatim.

Example
OpenAI API key    <your Astralane key>
Override base URL https://api.astralane.ai/v1
Custom model      openai/gpt-5.6-sol

cURL

The request the SDKs send, in full. Use it to check a key or a model id from a terminal.

Example
curl 'https://api.astralane.ai/v1/chat/completions' \
  -H "Authorization: Bearer $ASTRALANE_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"model":"openai/gpt-5.6-sol","messages":[{"role":"user","content":"Hello, world."}]}'

Verify the connection

List the catalog with your key before you change application code. A 200 with a model list means the base URL and the key are both right. A 401 means the key is wrong or revoked.

Example
curl 'https://api.astralane.ai/v1/models' \
  -H "Authorization: Bearer $ASTRALANE_API_KEY"

Prompt caching

Cached input tokens are metered and priced separately from fresh input tokens, and the catalog shows the cached rate next to the input rate. Caching is not automatic: it applies when the selected route and its provider support it, and the request metadata reports the cached token count so you can check.

Handoff release

Native core and mock HTTP checks have run. Full dependency install, PostgreSQL/Redis integration, production builds, and browser flows still require local verification. See the repository verification report before deployment.