Skip to content
AI GatewayAI Gateway Manual

Set up AI agents

Use common AI Gateway project model values, then choose the guide for your AI agent.

This guide explains the common values needed to connect AI agents to a project model. Use it as the index for the agent-specific guides below.

  • Install the client you want to use.
  • Issue a Gateway Key from the Gateway Keys menu of the project you want to use. See Issue a Gateway Key for the steps.
  • Check that the model you want appears in the Models menu of the same project.

A Gateway Key is a secret. Do not put the key value directly in source control, chat messages, or shared screenshots.

  • Model ID: the provider-name/model-id shown in the setup dialog.
  • Gateway base URL: the URL shown in the setup dialog, usually ending in /v1/.
  • API key environment variable: AI_GATEWAY_API_KEY.
  1. Set the Gateway Key as an environment variable where the client runs:

    Terminal window
    export AI_GATEWAY_API_KEY='<your Gateway Key>'
  2. Point the client’s OpenAI-compatible endpoint to the Gateway base URL.

  3. Select the model ID shown in the setup dialog.

  • Codex (ChatGPT) — Covers Codex CLI and the ChatGPT desktop app.
  • Cursor — Configure Cursor to use a project model.
  • Pi — Configure Pi’s provider file.
  • Hermes — Configure Hermes’ custom provider.
  • Claude Code — Connect Claude Code to a project model.
  • Desktop Companion CLI — Use the signed macOS Desktop Companion CLI.

Restart the client if it was already running. Select the configured model and send a short request. If the response arrives, the connection works.

  1. Confirm that the model ID and Gateway base URL exactly match the setup dialog.
  2. Confirm that the API key is the Gateway Key issued for the same project.
  3. Confirm that the model is allowed in that project’s Models menu.
  4. If the model’s Provider is not visible to the project, ask an organization administrator to widen its project visibility. See Provider project visibility.
  5. If the request still fails, ask the AI Gateway administrator to check the route used by your client.