Skip to content

Providers ​

Edit ~/.config/yuke/providers.json to add a provider or change a built-in one. Without this file, yuke uses the built-in providers. To use another folder, see Configuration.

Credentials ​

Use /login in yuke to store an API key or an account login in auth.json in the data folder. Set the provider variable to use an API key from the environment. A stored API key takes priority over the variable.

ProviderCredential
anthropicANTHROPIC_API_KEY
openaiOPENAI_API_KEY
openrouterOPENROUTER_API_KEY
deepseekDEEPSEEK_API_KEY
groqGROQ_API_KEY
xaiXAI_API_KEY
mistralMISTRAL_API_KEY
togetheraiTOGETHER_API_KEY
cerebrasCEREBRAS_API_KEY
fireworks-aiFIREWORKS_API_KEY
minimaxMINIMAX_API_KEY
opencode, opencode-goOPENCODE_API_KEY
openai-codexChatGPT account login
xai-grokxAI (Grok) account login

An account login uses a device code: open the page that yuke shows, enter the code, and confirm. You can also run yuke login openai-codex or yuke login xai-grok from the shell. See Command line.

Run /logout or yuke logout <provider> to remove a stored login or API key. A variable stays: to stop using it, unset it.

Add a provider ​

This example adds a gateway:

json
{
  "providers": [{
    "id": "gateway",
    "baseUrl": "https://gateway.example/v1",
    "apiKeyEnv": "GATEWAY_API_KEY",
    "endpoints": [{
      "protocol": "openai_chat",
      "credentialHeader": "authorization_bearer"
    }],
    "models": [{ "id": "big", "upstreamId": "vendor/big" }]
  }]
}

yuke reads the key from GATEWAY_API_KEY or from /login.

Use /reload to reload the profile after an edit. The reload fails while a turn runs. A failed reload keeps the previous providers and plugins.

To use a model of this provider, pass --model gateway/big to yuke -p, or choose it with /model.

Local server ​

If the server needs no credential, omit apiKeyEnv and credentialHeader:

json
{
  "providers": [{
    "id": "local",
    "baseUrl": "http://127.0.0.1:8080/v1",
    "endpoints": [{ "protocol": "openai_chat" }],
    "models": [{ "id": "my-model" }]
  }]
}

Change a built-in provider ​

Write an entry with the ID of a built-in provider. yuke keeps the built-in value of each field that you omit. When you write endpoints or a model entry, yuke replaces the built-in one as a whole. If you replace endpoints, keep an endpoint for the protocol of each model.

For example, this entry sends OpenAI requests through a proxy:

json
{
  "providers": [{ "id": "openai", "baseUrl": "http://127.0.0.1:8080/v1" }]
}

Fields ​

The file accepts JSON with // and /* */ comments. Unknown fields and bad routes stop startup. A null value is an error: omit a field to keep its built-in value.

yuke applies the entries in file order. A provider ID that an earlier entry has changes the result of that entry, and a model ID that an earlier model of the provider has replaces that model. In both cases the last value wins.

Provider fields ​

FieldMeaning
idRequired. It is not empty and has no /.
nameDisplay name. Defaults to the ID.
baseUrlA URL that starts with http:// or https://. yuke checks only this scheme. Required for a new provider.
apiKeyEnvThe environment variable for an API key. It is not empty and has no =. Omit it for a provider that needs no credential. On openai-codex and xai-grok, it is an error: these providers use an account login.
endpointsProtocol endpoints. Required for a new provider. Each protocol appears at most once.
headersExtra headers as [{ "name": "x-team", "value": "core" }]. A header must not replace a header that yuke writes.
sessionHeadernone (default), session_id, or x_opencode_session.
modelsModel entries. Required for a new provider.

Endpoint fields ​

FieldMeaning
protocolRequired: anthropic_messages (/messages), openai_chat (/chat/completions), or openai_responses (/responses). yuke appends the protocol path to the base URL.
credentialHeaderx_api_key, authorization_bearer, or api_key. Required when the provider sends a credential.
cacheBreakpointBoolean, default false. Marks an explicit prompt-cache breakpoint. openai_chat does not support true.
responsesDialectstandard (default) or codex. Only on openai_responses.
chatDialectstandard (default) or mistral. Only on openai_chat.

Model fields ​

FieldMeaning
idRequired and not empty. The model part of the selector.
upstreamIdThe model name that the host receives. Defaults to id.
nameDisplay name. Defaults to id.
protocolRequired when the provider has more than one endpoint.
limitscontextWindow and maxOutputTokens. Omitted values are unknown.
costPrice bands in USD per million tokens. See Cost.
reasoningLevelsThe efforts that the model takes, from minimal, low, medium, high, xhigh, and max. A null item means no effort. An empty list, the default, accepts any effort. See below.
flagsCapability facts. Omitted facts are unknown. See below.

A list that is not empty limits the efforts: yuke rejects an effort that the list does not name. A null item adds no choice to /model. An empty list lets --reasoning take any effort, but /model then offers only default and off.

/model offers default, each effort of reasoningLevels, and off when the model can turn reasoning off.

Model flags ​

FlagMeaning
supportsToolSearchWhether the model supports deferred tool search.
canDisableReasoningfalse rejects an explicit off choice.
supportsCacheBreakpointWhether the model accepts an explicit cache marker.
thinkingFormatChat Completions only: none (default), openai, openrouter, deepseek, zai, or qwen.
reasoningReplayChat Completions only: none (default), reasoning_content, or reasoning_details.
maxTokensFieldChat Completions only: max_tokens (default) or max_completion_tokens.
anthropicThinkingMessages only: toggle, adaptive, or budget.
reasoningBudgetMin, reasoningBudgetMaxBounds for anthropicThinking: "budget".

Cost ​

cost is a list of price bands. The first band starts at 0, so it can omit minPromptTokens. Each later band sets a higher minPromptTokens. A price is not negative. The last band that the prompt size reaches prices the whole request. Prices are input, output, reasoning, cacheRead, and cacheWrite. A missing price is unknown, not zero. For example:

json
"cost": [
  { "input": 4, "output": 20, "cacheRead": 0.4 },
  { "minPromptTokens": 272001, "input": 8, "output": 30, "cacheRead": 0.8 }
]

Network ​

yuke checks the certificate of an https host against root certificates:

  • On macOS, yuke reads the roots from the file in SSL_CERT_FILE. Without this variable, it reads /etc/ssl/cert.pem.
  • On Linux, SSL_CERT_FILE or SSL_CERT_DIR names the exact roots. Without them, yuke reads the system bundle file. It reads the certificate folders of the system only when no bundle file exists. A root that only a folder holds needs SSL_CERT_DIR.

This applies to model requests, logins, and the fetch of plugins. Set one of these variables when a private gateway or a network that inspects TLS signs with its own root.

yuke does not read HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, or NO_PROXY. To send the requests of a provider through a proxy or a gateway, set its baseUrl. The git program that installs plugins uses its own proxy settings.