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

# Gateway Quickstart

> Point your existing OpenAI client at HYRE — two lines of config, no other code changes.

Everything below assumes you already have a `hyre_gw_*` key — if not, [request access](/gateway/get-access) first.

## Base configuration

```
Base URL:  https://gw.hyreagent.fun/api/inference/v1
API key:   hyre_gw_...   (sent as a Bearer token)
```

## Make a request

<Tabs>
  <Tab title="curl">
    ```bash theme={null}
    curl https://gw.hyreagent.fun/api/inference/v1/chat/completions \
      -H "Authorization: Bearer $HYRE_GATEWAY_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "deepseek-ai/DeepSeek-V4-Flash",
        "messages": [
          { "role": "user", "content": "Explain impermanent loss in one paragraph." }
        ],
        "max_tokens": 300
      }'
    ```
  </Tab>

  <Tab title="Python (OpenAI SDK)">
    ```python theme={null}
    from openai import OpenAI

    client = OpenAI(
        base_url="https://gw.hyreagent.fun/api/inference/v1",
        api_key=os.environ["HYRE_GATEWAY_KEY"],  # hyre_gw_...
    )

    response = client.chat.completions.create(
        model="deepseek-ai/DeepSeek-V4-Flash",
        messages=[
            {"role": "user", "content": "Explain impermanent loss in one paragraph."}
        ],
        max_tokens=300,
    )
    print(response.choices[0].message.content)
    ```
  </Tab>

  <Tab title="Node.js (OpenAI SDK)">
    ```typescript theme={null}
    import OpenAI from 'openai'

    const client = new OpenAI({
      baseURL: 'https://gw.hyreagent.fun/api/inference/v1',
      apiKey: process.env.HYRE_GATEWAY_KEY, // hyre_gw_...
    })

    const response = await client.chat.completions.create({
      model: 'deepseek-ai/DeepSeek-V4-Flash',
      messages: [
        { role: 'user', content: 'Explain impermanent loss in one paragraph.' },
      ],
      max_tokens: 300,
    })
    console.log(response.choices[0].message.content)
    ```
  </Tab>

  <Tab title="Vercel AI SDK">
    ```typescript theme={null}
    import { createOpenAICompatible } from '@ai-sdk/openai-compatible'
    import { generateText } from 'ai'

    const hyre = createOpenAICompatible({
      name: 'hyre',
      baseURL: 'https://gw.hyreagent.fun/api/inference/v1',
      apiKey: process.env.HYRE_GATEWAY_KEY,
    })

    const { text } = await generateText({
      model: hyre('deepseek-ai/DeepSeek-V4-Flash'),
      prompt: 'Explain impermanent loss in one paragraph.',
    })
    ```
  </Tab>

  <Tab title="LangChain">
    ```python theme={null}
    from langchain_openai import ChatOpenAI

    llm = ChatOpenAI(
        base_url="https://gw.hyreagent.fun/api/inference/v1",
        api_key=os.environ["HYRE_GATEWAY_KEY"],
        model="deepseek-ai/DeepSeek-V4-Flash",
    )

    print(llm.invoke("Explain impermanent loss in one paragraph.").content)
    ```
  </Tab>
</Tabs>

## Streaming

Set `"stream": true` — the gateway streams standard OpenAI SSE chunks, including a final usage frame, so SDK streaming helpers work unchanged:

```python theme={null}
stream = client.chat.completions.create(
    model="zai-org/GLM-5",
    messages=[{"role": "user", "content": "Write a haiku about Solana."}],
    stream=True,
)
for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="")
```

## Supported parameters

The request schema follows OpenAI's `/chat/completions`:

| Parameter                              | Notes                                                         |
| -------------------------------------- | ------------------------------------------------------------- |
| `model`                                | Required — a catalog id from [`GET /models`](/gateway/models) |
| `messages`                             | Required — up to 1,000 messages                               |
| `max_tokens` / `max_completion_tokens` | Positive integer, capped at the model's context length        |
| `temperature`                          | `0` – `2`                                                     |
| `top_p`                                | `0` – `1`                                                     |
| `stop`                                 | String or array of strings                                    |
| `stream`                               | Boolean — SSE streaming                                       |
| `tools`, `tool_choice`                 | Function calling, passed through to the model                 |
| `response_format`                      | e.g. JSON mode, passed through to the model                   |

Every response carries an `X-Request-Id` header — include it when reporting an issue.

## Next steps

<CardGroup cols={2}>
  <Card title="Browse the model catalog" icon="layer-group" href="/gateway/models">
    20+ models across FLASH, STANDARD, and PREMIUM tiers with live pricing.
  </Card>

  <Card title="Limits & error handling" icon="triangle-exclamation" href="/gateway/limits-and-errors">
    Daily caps, error envelope, and status codes to handle in production.
  </Card>
</CardGroup>
