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

# Quick Integration

> Get started with AihubMax in minutes

## Overview

AihubMax provides a unified API gateway compatible with OpenAI standards. You can integrate with any AI model through a single API key and base URL.

<Info>
  **Base URL:** `https://api.aihubmax.com`
</Info>

## Step 1: Get Your API Key

1. Log in to the AihubMax Dashboard
2. Navigate to API Keys section
3. Click "Create New Key"
4. Copy the generated key (starts with `sk-`)

<Warning>
  Keep your API key secure. Never expose it in client-side code or public repositories.
</Warning>

## Step 2: Make Your First Request

<Tabs>
  <Tab title="cURL">
    ```bash theme={null}
    curl --request POST \
      --url https://api.aihubmax.com/v1/images/generations \
      --header 'Authorization: Bearer YOUR_API_KEY' \
      --header 'Content-Type: application/json' \
      --data '{
        "model": "gemini-3.1-flash-image-preview",
        "prompt": "A cat playing in the grass"
      }'
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    import requests

    response = requests.post(
        "https://api.aihubmax.com/v1/images/generations",
        headers={
            "Authorization": "Bearer YOUR_API_KEY",
            "Content-Type": "application/json"
        },
        json={
            "model": "gemini-3.1-flash-image-preview",
            "prompt": "A cat playing in the grass"
        }
    )

    result = response.json()
    task_id = result["id"]
    print(f"Task created: {task_id}")
    ```
  </Tab>

  <Tab title="JavaScript">
    ```javascript theme={null}
    const response = await fetch('https://api.aihubmax.com/v1/images/generations', {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer YOUR_API_KEY',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        model: 'gemini-3.1-flash-image-preview',
        prompt: 'A cat playing in the grass'
      })
    });

    const result = await response.json();
    console.log('Task created:', result.id);
    ```
  </Tab>
</Tabs>

## Step 3: Query Task Result

Most generation APIs use asynchronous processing. Use the returned task ID to check the result:

```bash theme={null}
curl --request GET \
  --url https://api.aihubmax.com/v1/tasks/YOUR_TASK_ID \
  --header 'Authorization: Bearer YOUR_API_KEY'
```

When `status` changes to `completed`, the `output` field will contain your generated content.

## Step 4: Use with Text Models

AihubMax is fully compatible with OpenAI's Chat Completions API:

```bash theme={null}
curl --request POST \
  --url https://api.aihubmax.com/v1/chat/completions \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "claude-sonnet-4-6",
    "messages": [
      {"role": "user", "content": "Hello, who are you?"}
    ]
  }'
```

## Authentication

All APIs require Bearer Token authentication. Add this header to every request:

```
Authorization: Bearer YOUR_API_KEY
```

## What's Next?

<CardGroup cols={2}>
  <Card title="API Manual" icon="book" href="/en/api-manual/image-series/nanobanana/gemini-3.1-flash-image-preview">
    Explore all available API endpoints
  </Card>

  <Card title="Integration Guide" icon="puzzle-piece" href="/en/integration-guide/claude-code-cli">
    Connect Claude Code CLI and other tools
  </Card>
</CardGroup>
