Docs/Getting Started/Connect a model provider

Connect a model provider

Graff can work on an existing repository using a subscription connection, a provider API key, or the Codegraff gateway. Choose the connection before running a task; a model name alone does not tell you which account will be billed.

Choose a connection

Run the login command for the account you intend to use. These commands are documented by the current Graff CLI help; login requires your own account and provider authorization.

Graff connections and their billing routes
ConnectionSetupAccess and cost
ChatGPT / Codexgraff login codexCodex OAuth; available models and usage depend on the authorized account.
Kimi Codegraff login kimiDevice-code OAuth; the connected Kimi account controls eligibility and limits.
Grok / SuperGrokgraff login xaiDevice-code OAuth; the connected account controls access and limits.
Provider APIA supported provider’s API-key environment variableUsage is billed by that provider. A consumer subscription does not establish API credit.
Codegraff gatewaygraff loginCodegraff device-code login. Gateway requests use Codegraff credits and the gateway model catalog.

Graff also recognizes an existing Codex CLI login. Keep credentials in your private environment or credential store. Use graff key list to inspect which providers have stored keys.

For gateway aliases and token prices, see Models and pricing. That catalog describes the gateway; it is not a compatibility list for every subscription connection.

Select and inspect a model

List the available catalog, then replace the placeholder below with the exact model you want. Model catalogs can change; inspect the route before starting inference.

bash
graff models

# Replace this value with a model from your catalog.
MODEL="your-model-id"
graff route "$MODEL"

graff route is a dry run: it reports provider and billing selection without an inference API call. If it chooses an unexpected connection, resolve the account or model configuration before running the task. Catalog availability does not prove your account can execute every listed model.

Run a first task

From your repository directory, use the model you just checked:

bash
graff --model "$MODEL" -p "Explain this repository and identify its documented test commands. Do not edit files or run tests."

This invokes the selected model and can consume usage. Follow the repository task walkthrough when you are ready to edit and verify a change.

Compatibility and limits

Changing providers can change tool behavior, context limits, latency and cost. A successful login or route inspection is not a task-quality benchmark. Check account eligibility and model availability in your connected provider; this guide makes no fixed price or unlimited-use promise.

Graff sends task context to the selected model connection. CodeDB’s local repository indexing is a separate data path. See the Graff and CodeDB setup guide for the relationship between the harness and its tools, and verification guide for checking results.

Command syntax checked against local Graff CLI help on September 13, 2026. Authentication and inference were not exercised as part of this documentation check.