> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gourmand.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Tetrate Agent Router Service

The **Tetrate Agent Router Service** provides a unified Gateway for accessing various AI models with fast inference capabilities.

This gateway acts as an intelligent router that can distribute requests across multiple model providers, offering enterprise-grade reliability and performance optimization.

<Tip>
  Want to get started quickly? Sign up for the [Tetrate Agent Router Service](https://router.tetrate.ai/) to get an API key, then use [Tetrate on Gobi Hub](https://hub.gourmand.dev/tetrate) to get started fast.
</Tip>

## Setup

<Steps>
  <Step title="Sign in or sign up">
    Visit the [Agent Router Service portal](https://router.tetrate.ai/) and create an account to get your API key

    <img src="https://mintcdn.com/gourmand/cY6wRTl5s2wbpiM-/customize/model-providers/assets/tetrate-sign-in.png?fit=max&auto=format&n=cY6wRTl5s2wbpiM-&q=85&s=1f965319a4bf4c050ff65dd82b24a357" alt="Tetrate sign in page" style={{width: '250px', maxWidth: '100%'}} width="824" height="1168" data-path="customize/model-providers/assets/tetrate-sign-in.png" />
  </Step>

  <Step title="Get your API key">
    Go to the [API keys page](https://router.tetrate.ai/api-keys) to get your key

    <img src="https://mintcdn.com/gourmand/cY6wRTl5s2wbpiM-/customize/model-providers/assets/tetrate-get-api-key.png?fit=max&auto=format&n=cY6wRTl5s2wbpiM-&q=85&s=e444e0eabbf9d3ad11d1be4cc1aa93b7" alt="Tetrate get API key" style={{width: '250px', maxWidth: '100%'}} width="500" height="722" data-path="customize/model-providers/assets/tetrate-get-api-key.png" />
  </Step>

  <Step title="Configure Gobi">
    * Choose a configuration method below.
    * If you use the Gobi VS Code extension, install version `>=1.2.3`.
  </Step>
</Steps>

### Quickstart with Gobi Hub

Fastest way: use preconfigured models from Tetrate on Gobi Hub

<Steps>
  <Step title="Browse models">
    Open [Tetrate on Gobi Hub](https://hub.gourmand.dev/tetrate) and pick a model (e.g., [Claude Sonnet 4](https://hub.gourmand.dev/tetrate/claude-sonnet-4))
  </Step>

  <Step title="Use or remix">
    Click "Use Model", or "Remix" to change the model ID if needed
  </Step>

  <Step title="Add your API key">
    Add your API key to Gobi. See [adding secrets in Gobi Hub](/hub/secrets/secret-types) and [managing local secrets in the FAQ](/faqs#managing-local-secrets-and-environment-variables)

    <Tip>
      Add it as a Gobi Hub secret named `TETRATE_API_KEY` to reuse across projects.
    </Tip>
  </Step>
</Steps>

<img src="https://mintcdn.com/gourmand/cY6wRTl5s2wbpiM-/customize/model-providers/assets/tetrate-remix.png?fit=max&auto=format&n=cY6wRTl5s2wbpiM-&q=85&s=adf8a7599800f509b506f708b9629fc7" alt="Remix a model from Tetrate on Gobi Hub" width="1648" height="1160" data-path="customize/model-providers/assets/tetrate-remix.png" />

<Info>
  If a model is missing, remix a similar one and set the `model` field to the target ID.
</Info>

### Configuration Methods

<CardGroup cols={1}>
  <Card title="In Local Agent Configuration" icon="folder" vertical>
    Use a Tetrate model block from the Hub or define it directly in your local agent configuration.
  </Card>

  <Card title="Gobi Hub" icon="cloud" vertical>
    Use a Tetrate model block from the Hub or define your own on the Hub.
  </Card>

  <Card title="Using Local Model Blocks" icon="file-lines" vertical>
    Create a local model block for reuse across agents without publishing it to the Hub.
  </Card>
</CardGroup>

### Configuration Examples

<Info>
  **Click a tab** to see an example.
</Info>

<Tabs>
  <Tab title="In Local Agent Configuration">
    **When to use**: Simple local setups (like using the VS Code extension) when you don't need shared or published blocks.

    Use a Tetrate model block from the Hub in your local agent configuration:

    ```yaml title="~/.gobi/config.yaml" theme={null}
    name: Local Agent
    version: 1.0.0
    schema: v1
    models:
      - uses: tetrate/claude-sonnet-4
        with:
          TETRATE_API_KEY: ${{ secrets.TETRATE_API_KEY }}
    context:
      - provider: code
      - provider: docs
      - provider: diff
      - provider: terminal
      - provider: problems
      - provider: folder
      - provider: codebase
    ```

    Or define the model directly:

    ```yaml title="~/.gobi/config.yaml" theme={null}
    name: Local Agent
    version: 1.0.0
    schema: v1
    models:
      - name: Claude Sonnet 4
        provider: tars
        model: claude-4-sonnet-20250514
        apiKey: ${{ secrets.TETRATE_API_KEY }}
        roles:
          - chat
          - edit
          - apply
        capabilities:
          - tool_use
    context:
      - provider: code
      - provider: docs
      - provider: diff
      - provider: terminal
      - provider: problems
      - provider: folder
      - provider: codebase
    ```
  </Tab>

  <Tab title="Gobi Hub">
    **When to use**: Share configurations across teams or contribute to the community.

    **The Model Block:**

    ```yaml title="tetrate/claude-sonnet-4" theme={null}
    name: Claude Sonnet 4
    version: 1.0.14
    schema: v1
    models:
      - name: Claude Sonnet 4 - Tetrate
        provider: tars
        model: claude-4-sonnet-20250514
        apiKey: ${{ inputs.TETRATE_API_KEY }}
        roles:
          - chat
          - edit
          - apply
        capabilities:
          - tool_use
    ```

    View the model block `tetrate/claude-sonnet-4` on the [Gobi Hub](https://hub.gourmand.dev/tetrate/claude-sonnet-4).

    **Reference it in your Agent configuration:**

    ```yaml title="my-agent" theme={null}
    name: My Agent
    version: 1.0.0
    schema: v1
    models:
      - uses: tetrate/claude-sonnet-4
        with:
          TETRATE_API_KEY: ${{ secrets.TETRATE_API_KEY }}
    context:
      - uses: gourmand/diff-context
      - uses: gourmand/terminal-context
      - uses: gourmand/file-context
    ```

    <Tip>
      To customize, see the [model block creation guide](/hub/configs/create-a-block).
    </Tip>
  </Tab>

  <Tab title="Using Local Model Blocks">
    **When to use**: Reuse configurations across agents and keep them local or in GitHub (not on Gobi Hub).

    **The Local Model Block:**

    <Info>
      Name the file `my-claude-4-model.yaml` so you can reference it in the Agent.
    </Info>

    ```yaml title="~/.gobi/models/my-claude-4-model.yaml" theme={null}
    name: Claude Sonnet 4
    version: 1.0.1
    schema: v1
    models:
      - name: Claude Sonnet 4
        provider: tars
        model: claude-4-sonnet-20250514
        apiKey: ${{ inputs.TETRATE_API_KEY }}
        roles:
          - chat
          - edit
          - apply
        capabilities:
          - tool_use
    ```

    Reference it as `my-claude-4-model` in your Agent configuration:

    ```yaml title="~/.gobi/agents/simple-agent.yaml" theme={null}
    name: Simple Agent
    version: 1.0.0
    schema: v1
    models:
      - uses: my-claude-4-model
        with:
          TETRATE_API_KEY: ${{ secrets.TETRATE_API_KEY }}
    context:
      - uses: gourmand/diff-context
      - uses: gourmand/terminal-context
      - uses: gourmand/file-context
    ```

    <Tip>
      Learn more about [model blocks](/reference#models) and [local blocks](/reference#local-blocks).
    </Tip>
  </Tab>
</Tabs>

***

## Troubleshooting Common Issues

<CardGroup cols={2}>
  <Card title="Invalid API key" icon="key" vertical>
    Verify your API key is active and has no extra spaces.
  </Card>

  <Card title="Model not found" icon="ban" href="https://router.tetrate.ai/models" vertical>
    Confirm the model ID matches the Tetrate catalog.
  </Card>

  <Card title="Slow responses" icon="code" vertical>
    Check your network or try a less-loaded model. Contact Tetrate support if issues persist.
  </Card>

  <Card title="Configuration not loading" icon="file-lines" vertical>
    Validate YAML syntax and review error messages in Gobi. If using Hub, ensure the block is published.
  </Card>
</CardGroup>

***

## Join the Community

Connect with Tetrate and other builders for help and discussion.

<CardGroup cols={1}>
  <Card title="Join the Tetrate Community" icon="slack" href="https://join.slack.com/t/tetrate-agent-router/shared_invite/zt-399tv7hjm-6YMXztGywTOQrMIolvEBNg">
    Get answers, insights, and best practices for secure, scalable infrastructure
  </Card>
</CardGroup>
