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.
| Adapter | HTTP transport opt-in | API key lookup |
|---|---|---|
| Chat Completions | TOKENDANCE_GATEWAY_HTTP_TRANSPORT=1 | TOKENDANCE_GATEWAY_API_KEY, then OPENAI_API_KEY |
| Responses | TOKENDANCE_OPENAI_TRANSPORT=1 | TOKENDANCE_OPENAI_API_KEY, then OPENAI_API_KEY |
| Anthropic Messages | TOKENDANCE_ANTHROPIC_TRANSPORT=1 | TOKENDANCE_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