Documentation/API quick start

API quick start

Connect. Choose a model. Configure your agent.

1. Connect

Use the API key supplied by Badlands Labs. Request API access.

Connection settings
OpenAI base URLhttps://api.badlandslabs.com/v1
Anthropic base URLhttps://api.badlandslabs.com
AuthenticationAuthorization: Bearer <key> or x-api-key: <key>

Set BADLANDS_API_KEY in the terminal that launches your tool. Keep the key out of source files and browser-side code.

Windows · PowerShell
$credential = Get-Credential -UserName "badlands" -Message "Paste your API key in the password field"
$env:BADLANDS_API_KEY = $credential.GetNetworkCredential().Password
Remove-Variable credential
Invoke-RestMethod https://api.badlandslabs.com/v1/models -Headers @{ Authorization = "Bearer $env:BADLANDS_API_KEY" }
macOS / Linux · Bash
read -rsp "Badlands API key: " BADLANDS_API_KEY; echo
export BADLANDS_API_KEY
curl --fail-with-body https://api.badlandslabs.com/v1/models \
  -H "Authorization: Bearer $BADLANDS_API_KEY"

2. Choose a model

Use GET /v1/models with your key to list your account's model cards. Copy the complete ID into your agent's model setting.

Model cards · 19 IDs

Reference list checked on . Use the model IDs available to your account.

Model IDs
FamilyModel IDs
Anthropicanthropic/claude-opus-5.5
anthropic/claude-sonnet-5
anthropic/claude-haiku-4.5
OpenAIopenai/gpt-6-astra
openai/gpt-6.1-sol
openai/gpt-6-luna
Google Geminigoogle/gemini-3.1-pro-preview
google/gemini-3.8-flash
google/gemini-3.5-flash-lite
xAI Grokx-ai/grok-4.7
x-ai/grok-4.6
x-ai/grok-4.5
DeepSeekdeepseek/deepseek-v4-pro-0813
Qwenqwen/qwen3.8-max-0902
Moonshot AImoonshotai/kimi-k3
Z.AIz-ai/glm-5.3
MiniMaxminimax/minimax-m3
Badlands capabilitiesbadlands/advisor
badlands/image

The examples below configure openai/gpt-6.1-sol, or anthropic/claude-sonnet-5 for Claude Code. Replace these IDs with the model you want to use from your account's list.

3. Configure your agent

Choose your agent below. Set the key in the terminal that launches it, apply the configuration, and start a new session. Ask Reply with exactly PONG. to check the connection.

Codex CLI · Responses

Configured model in this example: openai/gpt-6.1-sol.

Edit your user config at ~/.codex/config.toml (Windows: %USERPROFILE%\.codex\config.toml). Merge these entries; keep top-level keys before any table headings.

model = "openai/gpt-6.1-sol"
model_provider = "badlands"

[model_providers.badlands]
name = "Badlands Labs"
base_url = "https://api.badlandslabs.com/v1"
env_key = "BADLANDS_API_KEY"
wire_api = "responses"
requires_openai_auth = false

Run codex from the terminal with the key. A custom-model metadata warning can appear; it is not an authentication failure.

Claude Code · Anthropic Messages

Configured model in this example: anthropic/claude-sonnet-5.

Use the root URL, without /v1. Set these variables in the same terminal as the key.

PowerShell:

$env:ANTHROPIC_BASE_URL = "https://api.badlandslabs.com"
$env:ANTHROPIC_AUTH_TOKEN = $env:BADLANDS_API_KEY
$env:ANTHROPIC_API_KEY = ""
$env:ANTHROPIC_MODEL = "anthropic/claude-sonnet-5"
claude

Bash:

export ANTHROPIC_BASE_URL="https://api.badlandslabs.com"
export ANTHROPIC_AUTH_TOKEN="$BADLANDS_API_KEY"
unset ANTHROPIC_API_KEY
export ANTHROPIC_MODEL="anthropic/claude-sonnet-5"
claude

Run /status to confirm the connection URL. If it shows another URL, check your Claude settings file for an override.

OpenCode · Chat Completions

Configured model in this example: openai/gpt-6.1-sol.

Merge this into opencode.json in your project. The key is read from your terminal environment.

{
  "$schema": "https://opencode.ai/config.json",
  "model": "badlands/openai/gpt-6.1-sol",
  "provider": {
    "badlands": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Badlands Labs",
      "options": {
        "baseURL": "https://api.badlandslabs.com/v1",
        "apiKey": "{env:BADLANDS_API_KEY}"
      },
      "models": {
        "openai/gpt-6.1-sol": { "name": "GPT-6.1 Sol" }
      }
    }
  }
}

Run opencode. The configured selection is badlands/openai/gpt-6.1-sol. To change it, update the models entry and the top-level model value, keeping the badlands/ prefix on that top-level value.

Cline · OpenAI Compatible

Configured model in this example: openai/gpt-6.1-sol.

Open Cline settings and fill in:

API ProviderOpenAI Compatible
Base URLhttps://api.badlandslabs.com/v1
API KeyYour Badlands-issued key (paste the value, not the variable name).
Model IDopenai/gpt-6.1-sol

Save for the mode you use; if Plan and Act have separate settings, configure both. Start a new task and send the connection-check prompt above.

DeepSeek Harness · Custom model API

Configured model in this example: openai/gpt-6.1-sol.

In the DSH Web UI, open Settings → Models → Add model provider → Custom model API.

Provider ID / namebadlands / Badlands Labs
Base URLhttps://api.badlandslabs.com/v1
API protocolOpenAI Chat Completions
CredentialYour Badlands-issued key.
Model ID / inputopenai/gpt-6.1-sol / Text

Save and select this provider's model for a new session. Use Fetch available models to choose another model.

Need help connecting? Contact Badlands Labs with your agent name, model ID, and error message. Keep your API key private.