Skip to content

Providers and Auth

Wayland Core ships five engine-native providers: Anthropic, OpenAI (and OpenAI-compatible backends), Google Gemini, AWS Bedrock, and Google Vertex AI. Each one is set in the config file or overridden per run with flags and environment variables.

Set a key in config, or pass it at run time:

[default]
provider = "anthropic"
[providers.anthropic]
# api_key = "sk-ant-xxx" # or set ANTHROPIC_API_KEY

You can also attempt to sign in to a Claude.ai subscription with OAuth instead of a key:

Terminal window
wayland-core --login # device flow, prints a URL and code to enter
wayland-core --logout # remove saved OAuth credentials

Credentials are saved next to the global config. Run wayland-core --config-path to find the directory.

The OpenAI provider also drives DeepSeek, Qwen, Ollama, vLLM, and other OpenAI-compatible endpoints. Point base_url at the backend:

[providers.deepseek]
provider = "openai"
model = "deepseek-chat"
api_key = "sk-xxx"
base_url = "https://api.deepseek.com"

Bedrock uses SigV4. Provide explicit credentials, an AWS profile, or let the standard environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN) resolve automatically:

[bedrock]
region = "us-east-1"
# access_key_id = "AKIA..."
# secret_access_key = "..."
# profile = "my-profile"

Vertex uses GCP OAuth2. Supply a service account key file, use Application Default Credentials from gcloud, or rely on the metadata server on GCE, GKE, and Cloud Run:

[vertex]
project_id = "my-gcp-project"
region = "us-central1"
credentials_file = "/path/to/service-account.json"

The auth subcommand reads and writes provider keys in the config, validating each key against the provider endpoint before it is saved:

Terminal window
wayland-core auth list # show configured providers, keys masked
wayland-core auth add anthropic sk-ant-xxx # validate, then store
wayland-core auth add autodetect sk-xxx # infer the provider from the key prefix
wayland-core auth remove openai # drop a provider table

Any single run can override the config. Flags win over environment variables, which win over the files:

Terminal window
wayland-core --provider openai --model gpt-4o --api-key sk-xxx "Summarize this repo"

The engine also reads PROVIDER, API_KEY, BASE_URL, and MODEL, plus provider-native keys like ANTHROPIC_API_KEY and OPENAI_API_KEY.

The engine classifies each request into a routing tier before sending it to the provider. The tier is stamped onto the request as a routing_hint (e.g. "premium:large_context") and surfaced in tracing spans; the actual model selected within that tier is the caller’s responsibility.

TierConditionReason label
Premiumrequires_vision = truerequires_vision
Premiuminput_tokens > 8000large_context
Premiumtool_call_count >= 3tool_heavy
Balancedcode_ratio >= 0.30code_heavy
Cheapall other requestssimple