CLI
Use this section when your AI tool runs from a terminal and reads configuration from environment variables or a local config file. Infer is OpenAI-compatible, so most CLI agents connect by setting two values: a base URL and an API key.
Codex
Use Infer as the OpenAI-compatible endpoint for Codex CLI and Codex integrations.
Claude Code
Point Claude Code at Infer's Anthropic-compatible endpoint without changing your agent workflow.

OpenCode
Add Infer as a custom provider in the OpenCode CLI.
Shared prerequisites
- Create an Infer API key in the API Keys dashboard.
- Make sure the team has available balance on the Billing page.
- Know the command your tool uses to launch (
codex,claude,opencode, …).
Common environment pattern
Every CLI guide below starts from the same Infer key, then adapts it to the configuration path that tool actually reads:
INFER_API_KEYholds the original key for reuse across shells.- Codex CLI and the VS Code Codex plugin read it directly through
env_key = "INFER_API_KEY"in~/.codex/config.toml. - Claude Code aliases it into
ANTHROPIC_AUTH_TOKEN="$INFER_API_KEY"and uses the Anthropic-compatible root base URL. - OpenCode uses
OPENAI_API_KEYandOPENAI_BASE_URLfor shell checks, then stores the same key and/v1base URL inopencode.jsonc.
Pick a guide to see the exact exports, config snippets, and launch commands for that tool.
Last updated on