Guide

Documentation

Connect an application, send the model you already use, and pay no more than the retail price.

Start

  1. Sign in. A paid request needs an available balance and a Dandelion API key.
  2. Check Billing. Add funds when that option is shown. Listing models does not create a charge.
  3. Open API keys and copy the secret once. The dashboard does not show it again. Revoke a key there when you no longer need it. Signing out does not revoke keys.
  4. Point an OpenAI client at https://api.trydandelion.io/v1. An Anthropic client uses https://api.trydandelion.io and calls /v1/messages. The website address does not accept inference requests.
  5. Send the exact model ID from the models page or from GET /v1/models. Dandelion does not rename the model you send.

Use your Dandelion API key, not a provider key. This chat completion can incur a charge. Keep an output limit.

curl https://api.trydandelion.io/v1/chat/completions \
  -H "Authorization: Bearer $DANDELION_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-4o-mini","messages":[{"role":"user","content":"Hello"}],"max_tokens":32}'

OpenAI and Anthropic SDKs

The same base URL works with the OpenAI SDK.

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.DANDELION_API_KEY,
  baseURL: "https://api.trydandelion.io/v1",
});

const response = await client.chat.completions.create({
  model: "gpt-4o-mini",
  messages: [{ role: "user", content: "Hello" }],
  max_tokens: 32,
});

The Anthropic SDK adds /v1/messages itself, so its base URL stops at the host. It sends the key in x-api-key.

import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  apiKey: process.env.DANDELION_API_KEY,
  baseURL: "https://api.trydandelion.io",
});

const response = await client.messages.create({
  model: "claude-haiku-4-5",
  max_tokens: 32,
  messages: [{ role: "user", content: "Hello" }],
});

Claude Code, Codex, VS Code, DeepSeek Harness, and other coding tools each have their own steps in Coding tools.

Coding tools

Every tool below needs the same three values: the Dandelion API key from API keys, a base URL, and an exact model ID from the models page. The model has to support the API that the tool sends. OpenAI-compatible tools use https://api.trydandelion.io/v1. Anthropic-compatible tools use https://api.trydandelion.io. These steps were checked against each tool's documentation on 10 November 2026; the tools change often, so compare with their current docs if a setting has moved.

Claude Code

Set the base URL to the host only. Claude Code adds /v1/messages itself. Put the Dandelion key in ANTHROPIC_API_KEY: Claude Code sends that variable as x-api-key, which is the header Messages reads. Leave ANTHROPIC_AUTH_TOKEN unset, because it sends a Bearer header that /v1/messages does not accept. Model values are exact Anthropic Messages IDs, such as claude-sonnet-5-5. Names like sonnet or opus are aliases, not model IDs.

export ANTHROPIC_BASE_URL=https://api.trydandelion.io
export ANTHROPIC_API_KEY="$DANDELION_API_KEY"
export ANTHROPIC_MODEL=claude-sonnet-5-5
export ANTHROPIC_DEFAULT_HAIKU_MODEL=claude-haiku-5-5

Start claude from that shell. The first interactive session asks you to approve the key once. ANTHROPIC_MODEL sets the session model. Claude Code runs small background tasks on the haiku alias, so pin it with ANTHROPIC_DEFAULT_HAIKU_MODEL. If you switch models with /model, pin ANTHROPIC_DEFAULT_SONNET_MODEL and ANTHROPIC_DEFAULT_OPUS_MODEL to Dandelion model IDs the same way.

To keep the settings across terminals, put the same variables in the env block of ~/.claude/settings.json. Do not put the key in a project's .claude/settings.json, which is committed with the repository.

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.trydandelion.io",
    "ANTHROPIC_API_KEY": "<your Dandelion API key>",
    "ANTHROPIC_MODEL": "claude-sonnet-5-5",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-5-5"
  }
}

The VS Code extension checks its credential before it launches, so set the same variables in claudeCode.environmentVariables in VS Code's user settings JSON (Preferences: Open User Settings (JSON)).

"claudeCode.environmentVariables": [
  { "name": "ANTHROPIC_BASE_URL", "value": "https://api.trydandelion.io" },
  { "name": "ANTHROPIC_API_KEY", "value": "<your Dandelion API key>" },
  { "name": "ANTHROPIC_MODEL", "value": "claude-sonnet-5-5" },
  { "name": "ANTHROPIC_DEFAULT_HAIKU_MODEL", "value": "claude-haiku-5-5" }
]

Covered: chat, tool calls, and streaming. Dandelion does not pass the anthropic-beta header to the provider, so Claude Code features that depend on it, such as extended context and interleaved thinking, are not available. Token counts shown by /context are estimates, and fast mode and Remote Control are unavailable with a gateway key.

Codex

In ~/.codex/config.toml, add a Dandelion provider and select it. env_key names the variable that holds the key, so export DANDELION_API_KEY in your shell. Codex speaks the Responses API, and responses is the only accepted wire_api, so choose a model whose row lists OpenAI Responses.

model = "gpt-5.4-mini"
model_provider = "dandelion"

[model_providers.dandelion]
name = "Dandelion"
base_url = "https://api.trydandelion.io/v1"
env_key = "DANDELION_API_KEY"
wire_api = "responses"

Alternatively, keep Codex's built-in OpenAI provider and set only its base URL, with the Dandelion key in OPENAI_API_KEY. Keep either setting in your user config. A project's .codex/config.toml ignores provider settings. Then run codex and send a short prompt.

openai_base_url = "https://api.trydandelion.io/v1"

VS Code

VS Code's Copilot Chat connects to Dandelion through its Custom Endpoint model provider, which replaced the earlier OpenAI Compatible provider. It supports chat and agent mode, not inline completions. On Copilot Business or Enterprise, an administrator has to allow bring-your-own-key first.

  1. Run Chat: Manage Language Models from the Command Palette, or open the gear icon in the chat model picker.
  2. Choose Add Models, then Custom Endpoint. Enter a group name such as Dandelion, a display name, the Dandelion key, and the API type for the first model.
  3. VS Code opens chatLanguageModels.json. Add one entry per model with the full endpoint URL, and set apiType per model when you mix Anthropic and OpenAI formats.
  4. Save, then pick the model in the chat model picker.
[
  {
    "name": "Dandelion",
    "vendor": "customendpoint",
    "apiKey": "${input:dandelionApiKey}",
    "models": [
      {
        "id": "claude-sonnet-5-5",
        "name": "Claude Sonnet 5.5 (Dandelion)",
        "apiType": "messages",
        "url": "https://api.trydandelion.io/v1/messages",
        "toolCalling": true,
        "maxInputTokens": 200000,
        "maxOutputTokens": 64000
      },
      {
        "id": "gpt-5.4-mini",
        "name": "GPT-5.4 mini (Dandelion)",
        "apiType": "chat-completions",
        "url": "https://api.trydandelion.io/v1/chat/completions",
        "toolCalling": true,
        "maxInputTokens": 128000,
        "maxOutputTokens": 16000
      }
    ]
  }
]

For the Messages API type, VS Code sends the key as x-api-key. For Chat Completions and Responses, it sends Authorization: Bearer. Both match what Dandelion expects. The token limits are examples: set maxInputTokens and maxOutputTokens from the model's documentation, because VS Code uses their sum as the context window. A model has to declare toolCalling to appear in agent mode. If you use the Responses API type, add "statefulResponses": false so VS Code sends the full conversation each time.

DeepSeek Harness

DeepSeek Harness (dsh) connects to Dandelion as a custom model API. Start the Web UI with npx @deepseek-ai/dsh web, then open Settings, Models, and Add model provider.

  1. Switch the card to Custom model API.
  2. Enter a lowercase Provider ID such as dandelion. It is permanent, because sessions and credentials reference it.
  3. Set the base URL to https://api.trydandelion.io/v1 and the API protocol to OpenAI Chat Completions, then paste the Dandelion key.
  4. Under Model catalog, choose Fetch available models and tick the models you want, or add model IDs by hand. Save, then select a model in the picker.

One provider speaks one protocol. For Claude models, add a second provider with the Anthropic Messages protocol and https://api.trydandelion.io as its base URL. The same provider can also be written into $DSH_HOME/profiles/web/cordis.patch.yml, which the Models page edits for you; the adapters re-read it on the next request. Keep every other provider in that file when you edit it.

- id: llm-pi-ai
  config:
    providers:
      dandelion:
        apiKeyEnv: DANDELION_API_KEY
        api: openai-completions
        baseURL: https://api.trydandelion.io/v1
        models:
          - id: deepseek-v4-pro
          - id: gpt-5.4-mini

Cline

In Cline's settings, set API Provider to OpenAI Compatible, the Base URL to https://api.trydandelion.io/v1, the API key to the Dandelion key without a Bearer prefix, and the Model ID to an exact model ID from the models page. Cline adds /chat/completions itself, so keep it off the base URL. Cline sends tool definitions with every request, so choose a model that supports function calling. Click Verify, then send a short task.

Continue

Add one model entry to Continue's config.yaml with the OpenAI provider and apiBase set to Dandelion. The keys are camelCase: apiBase and apiKey. Other spellings are silently ignored, and without apiBase the key goes to OpenAI instead.

name: Dandelion
version: 0.0.1
schema: v1
models:
  - name: GPT-5.4 mini (Dandelion)
    provider: openai
    model: gpt-5.4-mini
    apiBase: https://api.trydandelion.io/v1
    apiKey: <your Dandelion API key>
    roles:
      - chat
      - edit

OpenCode

Add a provider to opencode.jsonc with the OpenAI-compatible package, the base URL, and the models you want to use. env names the variable that holds the key. Model references are dandelion/ followed by the model ID. Restart OpenCode after editing the file.

{
  "$schema": "https://opencode.ai/config.json",
  "model": "dandelion/gpt-5.4-mini",
  "providers": {
    "dandelion": {
      "name": "Dandelion",
      "env": ["DANDELION_API_KEY"],
      "package": "@opencode/ai/providers/openai-compatible",
      "settings": { "baseURL": "https://api.trydandelion.io/v1" },
      "models": {
        "gpt-5.4-mini": { "name": "GPT-5.4 mini" },
        "deepseek-v4-pro": { "name": "DeepSeek V4 Pro" }
      }
    }
  }
}

Aider

Aider reads an OpenAI-compatible endpoint from two environment variables. Prefix the model ID with openai/.

export OPENAI_API_BASE=https://api.trydandelion.io/v1
export OPENAI_API_KEY="$DANDELION_API_KEY"
aider --model openai/gpt-5.4-mini

Cursor

Cursor's own API-key settings cover OpenAI, Anthropic, Google, Azure, and Bedrock keys and do not include a base URL for a different host. Some Cursor builds and plans still show an Override OpenAI Base URL toggle under Cursor Settings, Models, API Keys. If yours does, paste the Dandelion key into OpenAI API Key, turn the override on with https://api.trydandelion.io/v1, add a custom model whose name is an exact OpenAI-format model ID, and select it in Chat. The override applies to local Chat and Agent only, and Cursor has open issues with it in Agent mode. Tab and cloud agents keep using Cursor's own connection. If the toggle is absent, use one of the tools above.

Other apps

Any OpenAI-compatible client uses the base URL https://api.trydandelion.io/v1 and the Dandelion key as a Bearer token. Any Anthropic-compatible client uses https://api.trydandelion.io and the same key in x-api-key. Match the model ID to the endpoint that client calls.

Pricing

Dandelion fulfills the model you name through a distributed network of suppliers. That is how the same model can cost less. You still send the exact model ID. The amount you pay, including our fee, does not go above the retail price for that model's raw input and output tokens. We only earn a fee when you pay less than that retail price.

Savings depend on the model and the pricing available for the request. They are not guaranteed, and they are not a comparison with a negotiated, batch, or cache-discounted provider bill. Current retail rates are on the models page.

Homepage savings use the past 30 days in UTC. For each model, we divide total customer savings by total raw-token retail cost across all priced settlements in that window. This is a dollar-weighted average, including Dandelion's fee, rather than an average of request percentages. Settlements without a determined charge are omitted; one priced settlement is enough to show history. Models without priced settlements show no pricing history. The percentage is for the whole model charge, not separate input and output rates, and excludes provider cache discounts and hosted web tool charges.

A paid request needs enough available balance for its maximum charge at the retail price. That amount is held until the request settles to the actual charge. Set max_tokens or max_completion_tokens on chat completions, max_output_tokens on the Responses API, and max_tokens on Messages. Messages requires that limit.

Authentication

OpenAI-compatible calls, including GET /v1/models, POST /v1/chat/completions, POST /v1/responses, and POST /v1/decisions, send Authorization: Bearer and the Dandelion key. Anthropic-compatible POST /v1/messages sends that same key in x-api-key. The Anthropic client also sends anthropic-version.

Endpoints

  • GET /v1/models lists supported model IDs. It is free and uses the Bearer key.
  • POST /v1/chat/completions accepts an OpenAI chat completion for a model that supports that endpoint.
  • POST /v1/responses accepts an OpenAI Responses request. The output limit is max_output_tokens. Read text from output items whose content type is output_text.
  • POST /v1/messages accepts an Anthropic Messages request. Read text from content blocks whose type is text.
  • POST /v1/decisions is for models labeled Decisions on the models page, with the same Bearer key. Send the model and either state plus a questions object, or input plus a questions list, and not both. These requests do not stream.

Tools

Dandelion can run a web search or open a public page for you. Send the same tool declaration your OpenAI or Anthropic client already uses. A function you define and name web_search or fetch stays yours to run. Each search or page open is a separate charge of one cent, in addition to the model charge. The model charge still stays within that model's retail price. Set an output limit on the request.

web_search

Put the tool in the tools list. Chat Completions and the Responses API both accept {"type":"web_search"} and {"type":"web_fetch"}. Chat Completions also accepts web_search_options. Dandelion runs those tools. The model provider receives ordinary function declarations and does not run the search or the page open. The answer is a normal completion, with links to the pages that were actually retrieved.

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.DANDELION_API_KEY,
  baseURL: "https://api.trydandelion.io/v1",
});

const response = await client.chat.completions.create({
  model: "gpt-4o-mini",
  max_tokens: 400,
  messages: [
    { role: "user", content: "What changed on example.com today?" },
  ],
  tools: [{ type: "web_search" }, { type: "web_fetch" }],
});

The older web_search_preview declaration is accepted too. A page open comes back on the Responses API as a web_search_call whose action is open_page.

const response = await client.responses.create({
  model: "gpt-4o-mini",
  max_output_tokens: 400,
  tools: [{ type: "web_search" }, { type: "web_fetch" }],
  input: "What changed on example.com today?",
});

web_fetch

Messages uses the hosted tool types web_search_20250305 and web_fetch_20250910. Results come back as server_tool_use blocks paired with web_search_tool_result or web_fetch_tool_result. You do not run these two tools yourself. encrypted_content and encrypted_index are Dandelion values. Send the full message back on a later request when you want that result reused. Dandelion does not fetch it again.

const response = await client.messages.create({
  model: "claude-haiku-4-5",
  max_tokens: 400,
  tools: [
    { type: "web_search_20250305", name: "web_search", max_uses: 4 },
    { type: "web_fetch_20250910", name: "web_fetch", max_uses: 2 },
  ],
  messages: [
    { role: "user", content: "Open example.com and quote its title." },
  ],
});

A request that uses these tools finishes the search or fetch before it returns. If you set stream to true, the events arrive together after that work. X-Dandelion-Max-Tool-Cost-Usd can set a lower tool budget for that request. The response headers x-dandelion-inference-cost-usd, x-dandelion-tool-cost-usd, and x-dandelion-total-cost-usd show the two charges when both are known.

Streaming

Set stream to true on chat completions, responses, or messages when you want the response as it is produced. OpenAI-compatible streams are server-sent events and finish with data: [DONE]. Keep the connection open until that marker. Chat completions can include usage with stream_options.include_usage. If bytes have already arrived and the stream then fails, the request stops there. Check Activity before sending it again.

Errors

API errors and what to do next
What you seeWhat to do
401 invalid_api_keyThe key is missing, revoked, or is not a Dandelion API key. A browser sign-in token cannot call the API.
402 insufficient_fundsAvailable balance cannot cover this request's maximum charge at the retail price. Check Billing, add funds when that option is shown, and set an output limit.
400 unsupported_modelThe model ID or the endpoint does not match a supported model. Compare it with the models page and with GET /v1/models.
503 dandelion_no_execution_liquidityNo capacity was available for this request. Check Activity before you decide whether to send it again.
503 dandelion_execution_exhaustedThe request could not be completed. Check Activity before you send it again.
Other error or a timeoutSave the x-dandelion-request-id response header and check Activity. A timeout does not show that work never started.

After a request

After a completed request, review Activity, Usage, and Billing. Activity shows the request, Usage shows tokens and spend, and Billing shows the balance and each posted charge. A small charge can be finer than a rounded summary. Model listing does not appear as an inference charge.

Privacy

Dandelion handles the request and sends it to the model provider. Prompts and outputs are not kept in durable storage or logs. The provider's own data policies still apply.