Skip to main content
TokenDance Code
中文
Updated 2026-10-22

Providers

Current CLI behavior

The Rust CLI uses MockProvider for one-shot and interactive sessions. No API key is needed for the quickstart. Provider settings or environment variables do not currently select a different provider in those entry points.

Adapter implementations

The core library contains adapters for OpenAI Chat Completions, OpenAI Responses, and Anthropic Messages. Contributors can construct a provider through the core API and pass it to Runtime; this is a development API, not a released npm SDK contract.

AdapterHTTP transport opt-inAPI key lookup
Chat CompletionsTOKENDANCE_GATEWAY_HTTP_TRANSPORT=1TOKENDANCE_GATEWAY_API_KEY, then OPENAI_API_KEY
ResponsesTOKENDANCE_OPENAI_TRANSPORT=1TOKENDANCE_OPENAI_API_KEY, then OPENAI_API_KEY
Anthropic MessagesTOKENDANCE_ANTHROPIC_TRANSPORT=1TOKENDANCE_ANTHROPIC_API_KEY, then ANTHROPIC_API_KEY

The adapter also needs a model identifier and the appropriate base URL in ProviderConfig. TokenDance Gateway uses the compatible Chat Completions adapter. Read the configured provider’s data policy: requests can include prompts, code context, and tool results.

Validate an integration

Verify provider selection, transport opt-in, model access, and an actual request result independently. A doctor result that says mock or a successful settings check does not prove that a real model request succeeded.

See the adapter source for the current constructor and request contracts.

Edit this page on GitHub