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

# Quickstart

> Create an API key, verify your model list, and send your first AIOHub API request.

## Before you start

You need an AIOHub account with a positive balance. For the first test, use the OpenAI-compatible API, then switch formats when a client requires Claude Messages, Responses, or Gemini API endpoints.

## First request in four steps

<Steps>
  <Step title="Open the console">
    Sign in to the [AIOHub Console](https://api.aiohub.org/console). Confirm that your account has a positive balance in [wallet management](https://api.aiohub.org/console/topup). If you need to add funds, see [Add funds](/en/account/recharge).
  </Step>

  <Step title="Create an API key">
    Open [API key management](https://api.aiohub.org/console/token) and create an API key that starts with `sk-`. Use one API key per tool when you want separate limits and usage logs.

    <Warning>API keys are secrets. Do not share them or commit them to source control.</Warning>
  </Step>

  <Step title="Verify available models">
    Request the model list first. This confirms that your API key, balance, and group access are valid.

    ```bash theme={"system"}
    curl https://api.aiohub.org/v1/models \
      -H "Authorization: Bearer sk-your-api-key"
    ```

    A successful response returns the models visible to the groups assigned to the current API key.
  </Step>

  <Step title="Send a chat request">
    Send your first basic chat request with the OpenAI-compatible API.

    <CodeGroup>
      ```bash cURL theme={"system"}
      curl https://api.aiohub.org/v1/chat/completions \
        -H "Authorization: Bearer sk-your-api-key" \
        -H "Content-Type: application/json" \
        -d '{
          "model": "gpt-4o",
          "messages": [{"role": "user", "content": "Hello!"}]
        }'
      ```

      ```python Python theme={"system"}
      from openai import OpenAI

      client = OpenAI(
          base_url="https://api.aiohub.org/v1",
          api_key="sk-your-api-key"
      )

      response = client.chat.completions.create(
          model="gpt-4o",
          messages=[{"role": "user", "content": "Hello!"}]
      )
      print(response.choices[0].message.content)
      ```

      ```javascript Node.js theme={"system"}
      import OpenAI from "openai";

      const client = new OpenAI({
        baseURL: "https://api.aiohub.org/v1",
        apiKey: "sk-your-api-key",
      });

      const response = await client.chat.completions.create({
        model: "gpt-4o",
        messages: [{ role: "user", content: "Hello!" }],
      });
      console.log(response.choices[0].message.content);
      ```
    </CodeGroup>
  </Step>
</Steps>

## Choose an API format

| Use case                    | Base URL                        | Endpoint                                      |
| --------------------------- | ------------------------------- | --------------------------------------------- |
| OpenAI SDK / general tools  | `https://api.aiohub.org/v1`     | `POST /chat/completions`                      |
| Codex CLI                   | `https://api.aiohub.org/v1`     | `POST /responses`                             |
| Anthropic SDK / Claude Code | `https://api.aiohub.org`        | `POST /v1/messages`                           |
| Gemini CLI                  | `https://api.aiohub.org`        | `POST /v1beta/models/{model}:generateContent` |
| Gemini REST / Google SDK    | `https://api.aiohub.org/v1beta` | `POST /models/{model}:generateContent`        |

<Tip>If you are unsure which format a client needs, start with the matching client guide. If you are writing API code directly, start with OpenAI Chat Completions.</Tip>

## Next steps

<Columns cols={2}>
  <Card title="Choose a client" icon="plug" href="/en/clients">
    Configure Claude Code, Codex CLI, Gemini CLI, OpenAI-compatible apps, or chat clients.
  </Card>

  <Card title="Understand groups" icon="layers-3" href="/en/account/groups">
    Confirm that the groups assigned to your API key can access the target model.
  </Card>

  <Card title="Read the API overview" icon="book-open" href="/en/api/overview">
    Compare formats, auth headers, and supported endpoint families.
  </Card>

  <Card title="Troubleshoot errors" icon="wrench" href="/en/support/troubleshooting">
    Fix authentication failures, insufficient balance, network issues, and model availability errors.
  </Card>
</Columns>
