# GGet Comprehensive LLM & Knowledge Specification

> GGet 提供稳定便捷的 AI API 聚合服务，支持 OpenAI、Claude、Gemini 等主流模型，通过统一接口快速接入，并提供模型管理、用量统计和灵活计费功能

This file is dynamically generated from the current site SEO settings, navigation visibility, canonical origin, and documentation Markdown content.

## Product Summary

GGet is a multi-tenant AI API gateway and management platform. It provides OpenAI-compatible API access to multiple AI model providers, model routing, API key permissions, usage logs, billing visibility, and developer documentation.

## Core Pages

- [Home](https://gget.ai/): Overview of the GGet AI API gateway platform.
- [Model Square](https://gget.ai/pricing): Browse available AI models, pricing, and model access information.
- [Documentation](https://gget.ai/docs): Main documentation entry for developers.
- [API Reference](https://gget.ai/docs/api-reference): API examples for OpenAI-compatible and Anthropic-compatible requests.
- [Blog](https://gget.ai/blogs): Articles about AI API routing, cost optimization, API keys, and gateway architecture.
- [About](https://gget.ai/about): Product and platform information.

## Developer Guides

- [Documentation Home](https://gget.ai/docs): Main documentation entry for developers.
- [Quick Start](https://gget.ai/docs/quick-start): Create an account, get an API key, add credit, and make the first request.
- [Claude Code Setup](https://gget.ai/docs/claude-code): Configure Claude Code to use this platform as an API gateway.
- [Codex Setup](https://gget.ai/docs/codex): Configure Codex or OpenAI-compatible clients with this platform.
- [API Reference](https://gget.ai/docs/api-reference): Authentication, request examples, streaming, rate limits, and API formats.
- [FAQ](https://gget.ai/docs/faq): Common questions about setup, API usage, billing, and troubleshooting.

## API Information

- API format: OpenAI-compatible JSON APIs.
- Streaming: Server-Sent Events where supported.
- Authentication: API key authentication with `Authorization: Bearer YOUR_API_KEY`.
- API reference: https://gget.ai/docs/api-reference

## Documentation Content

### Quick Start

Source: https://gget.ai/docs/quick-start

<!-- docs-icon: 🚀 -->

## 1. Register an Account

Click "[Quick Start / Console](/dashboard)" in the top navigation bar and register with your email

## 2. Get an API Key

- Go to the Console and click "[Create API Key](/keys)"
- Copy and securely save the generated Key

{% hint style="info" %}
Note: The API Key is only displayed once upon creation. Please save it immediately. If lost, delete the old Key in the Console and create a new one.
{% endhint %}

## 3. Purchase Credits

- Console → [Credit Management](/dashboard)
- Select a tier and complete payment
- Once credits are added, you can call the API (usually instant, though delays may occur)

## 4. Make Your First Request

> Replace `YOUR_API_KEY` with your actual API Key:

{% tabs %}
{% tab title="Anthropic Protocol" %}

```shell
curl --request POST
  --url https://gget.ai/v1/messages
  --header 'content-type: application/json'
  --header 'x-api-key: YOUR_API_KEY'
  --data '{
    "model": "claude-opus-4-6",
    "max_tokens": 1024,
    "messages": [
      {
        "role": "user",
        "content": "Hello!"
      }
    ]
  }'
```

{% endtab %}
{% tab title="OpenAI Protocol" %}

```shell
curl https://gget.ai/v1/responses \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-YOUR_API_KEY" \
  -d '{
    "model": "gpt-5.3-codex",
    "input": "Hello!",
    "stream": false
  }'
```

{% endtab %}
{% endtabs %}

### Claude Code Setup

Source: https://gget.ai/docs/claude-code

Install and configure [Claude Code](https://docs.claude.com/en/docs/claude-code/overview) to use Claude models through GGet.

{% hint style="warning" %}
Claude Code only supports Claude models. GPT models are not supported.
{% endhint %}

## 1. One-click script (recommended)

The script detects Node.js and Claude Code and walks you through installing whatever is missing. It then prompts for your API key and writes `ANTHROPIC_BASE_URL`, `ANTHROPIC_AUTH_TOKEN`, and `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`. The command you copy contains no secret.

{% tabs %}
{% tab title="Windows" %}

```powershell
irm https://gget.ai/install/claude-code.ps1 | iex
```

**How to run it:**

1. Press the **Win** key, type `PowerShell`, right-click **Windows PowerShell**, and choose **Run as administrator**.
2. Copy the command above, **right-click** inside the PowerShell window to paste it, then press **Enter**.
3. If the script reports that Node.js or Claude Code is missing, type `Y` and press Enter to install it.

{% endtab %}
{% tab title="macOS" %}

```bash
curl -fsSL https://gget.ai/install/claude-code.sh | bash
```

**How to run it:**

1. Press **Command + Space** to open Spotlight, type `Terminal`, and press Enter.
2. Copy the command above, paste it into the terminal with **Command + V**, then press **Enter**.
3. Then follow the on-screen prompts.

{% endtab %}
{% tab title="Linux / WSL" %}

```bash
curl -fsSL https://gget.ai/install/claude-code.sh | bash
```

**How to run it:**

1. Open a terminal — on Linux press **Ctrl + Alt + T**; on WSL, open PowerShell first, type `wsl`, and press Enter to enter the Linux environment.
2. Copy the command above, paste it into the terminal (**Ctrl + Shift + V** in most terminals, or right-click), then press **Enter**.
3. Then follow the on-screen prompts.

{% endtab %}
{% endtabs %}

The script does the following:

- Checks your Node.js version. If it is missing or older than 18, it offers to install the LTS release via nvm (winget on Windows).
- Checks for the `claude` command and offers to install it via npm.
- Writes the configuration to your shell profile (macOS/Linux) or your user-level environment variables (Windows).
- Creates `~/.claude.json` so the first-run onboarding flow is skipped.

{% hint style="info" %}
A Claude Code session that is already running must be restarted before it picks up the new configuration. On macOS/Linux run `source ~/.zshrc` (or the matching rc file); on Windows, reopen PowerShell.
{% endhint %}

{% hint style="warning" %}
If you previously set `ANTHROPIC_API_KEY`, it takes precedence over `ANTHROPIC_AUTH_TOKEN` and sends requests back to Anthropic's official endpoint. Remove that variable first.
{% endhint %}

## 2. Manual setup

{% expand title="Alternative: set up Claude Code manually" desc="Use these steps only when the one-click script is unavailable." %}

Three steps: **install Claude Code → create the config files → launch**. Before you start, make sure [Node.js](https://nodejs.org/) 18+ is installed (on Windows, install [WSL](https://learn.microsoft.com/en-us/windows/wsl/install) or [Git for Windows](https://git-scm.com/download/win) first). Pick your OS and paste each step's commands as a whole.

{% tabs %}
{% tab title="Windows" %}

**Step 1: Install Claude Code**

```powershell
npm install -g @anthropic-ai/claude-code
# Verify the installation — a version number means it worked
claude --version
```

**Step 2: Create the config files**

Paste the whole block into PowerShell. It writes `%USERPROFILE%\.claude\settings.json` and `.claude.json` (existing files are overwritten, giving you a clean config):

```powershell
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.claude" | Out-Null

@'
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://gget.ai",
    "ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
  }
}
'@ | Set-Content -Path "$env:USERPROFILE\.claude\settings.json" -Encoding utf8

@'
{
  "hasCompletedOnboarding": true
}
'@ | Set-Content -Path "$env:USERPROFILE\.claude.json" -Encoding utf8
```

Replace `YOUR_API_KEY` with an API key copied from the console.

**Step 3: Launch**

```powershell
claude
```

{% endtab %}
{% tab title="macOS" %}

**Step 1: Install Claude Code**

```bash
npm install -g @anthropic-ai/claude-code

# Verify the installation — a version number means it worked
claude --version
```

**Step 2: Create the config files**

Paste the whole block. It writes `~/.claude/settings.json` and `~/.claude.json` (existing files are overwritten, giving you a clean config):

```bash
mkdir -p ~/.claude

cat > ~/.claude/settings.json <<'EOF'
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://gget.ai",
    "ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
  }
}
EOF

cat > ~/.claude.json <<'EOF'
{
  "hasCompletedOnboarding": true
}
EOF
```

Replace `YOUR_API_KEY` with an API key copied from the console.

**Step 3: Launch**

```bash
claude
```

{% endtab %}
{% tab title="Linux / WSL" %}

**Step 1: Install Claude Code**

```bash
npm install -g @anthropic-ai/claude-code

# Verify the installation — a version number means it worked
claude --version
```

**Step 2: Create the config files**

Paste the whole block. It writes `~/.claude/settings.json` and `~/.claude.json` (existing files are overwritten, giving you a clean config):

```bash
mkdir -p ~/.claude

cat > ~/.claude/settings.json <<'EOF'
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://gget.ai",
    "ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
  }
}
EOF

cat > ~/.claude.json <<'EOF'
{
  "hasCompletedOnboarding": true
}
EOF
```

Replace `YOUR_API_KEY` with an API key copied from the console.

**Step 3: Launch**

```bash
claude
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
If you previously set the `ANTHROPIC_API_KEY` environment variable, it takes precedence over the `ANTHROPIC_AUTH_TOKEN` in the settings file and sends requests back to the official Anthropic endpoint. Remove it first.
{% endhint %}

{% hint style="info" %}
`ANTHROPIC_BASE_URL` carries no `/v1` suffix. After reopening your terminal, the first time you launch inside a project directory choose "Trust This Folder" to let Claude Code read the project files.
{% endhint %}

{% endexpand %}

## 3. Troubleshooting

**401 / authentication failure**

Check that the API key is correct and that no stale `ANTHROPIC_API_KEY` remains. That variable has the highest precedence and overrides `ANTHROPIC_AUTH_TOKEN`.

**Requests still go to api.anthropic.com**

`ANTHROPIC_BASE_URL` did not take effect. Confirm it is written to the profile of your current shell and that you reopened the terminal. Note that the base URL carries no `/v1` suffix.

**`claude` command not found**

The npm global install directory is not on your `PATH`. Run `npm config get prefix` and add the `bin` directory under that prefix to `PATH`.

**Switching models**

Run `/model` inside a session, or set the `ANTHROPIC_MODEL` environment variable to a model ID.

### Codex Setup

Source: https://gget.ai/docs/codex

Install and configure [Codex](https://developers.openai.com/codex/quickstart) to use GPT models through GGet, driven by the `~/.codex` directory.

{% hint style="warning" %}
Codex only supports OpenAI models. Claude models are not supported.
{% endhint %}

## 1. One-click script (recommended)

The script detects Node.js and the Codex CLI and walks you through installing whatever is missing. It then asks which client you use, prompts for your API key and model ID, and writes the `~/.codex` configuration. The command you copy contains no secret.

{% tabs %}
{% tab title="Windows" %}

```powershell
irm https://gget.ai/install/codex.ps1 | iex
```

**How to run it:**

1. Press the **Win** key, type `PowerShell`, right-click **Windows PowerShell**, and choose **Run as administrator**.
2. Copy the command above, **right-click** inside the PowerShell window to paste it, then press **Enter**.
3. If the script reports that Node.js or Codex CLI is missing, type `Y` and press Enter to install it.

{% endtab %}
{% tab title="macOS" %}

```bash
curl -fsSL https://gget.ai/install/codex.sh | bash
```

**How to run it:**

1. Press **Command + Space** to open Spotlight, type `Terminal`, and press Enter.
2. Copy the command above, paste it into the terminal with **Command + V**, then press **Enter**.
3. Then follow the on-screen prompts.

{% endtab %}
{% tab title="Linux / WSL" %}

```bash
curl -fsSL https://gget.ai/install/codex.sh | bash
```

**How to run it:**

1. Open a terminal — on Linux press **Ctrl + Alt + T**; on WSL, open PowerShell first, type `wsl`, and press Enter to enter the Linux environment.
2. Copy the command above, paste it into the terminal (**Ctrl + Shift + V** in most terminals, or right-click), then press **Enter**.
3. Then follow the on-screen prompts.

{% endtab %}
{% endtabs %}

The script does the following:

- Checks your Node.js version. If it is missing or older than 18, it offers to install the LTS release via nvm (winget on Windows).
- Checks for the `codex` command and offers to install it via npm.
- Writes `~/.codex/config.toml` and `~/.codex/auth.json`, backing up any existing file as `.bak.<timestamp>` first.

{% hint style="info" %}
Once the configuration lands in `~/.codex`, both the Codex CLI and the Codex desktop app pick it up. If you don't have the desktop app yet, download it from <https://chatgpt.com/codex/>. A client that is already open must be fully quit and relaunched.
{% endhint %}

## 2. Manual setup

{% expand title="Alternative: set up Codex manually" desc="Use these steps only when the one-click script is unavailable." %}

Three steps: **install Codex → create the config files → launch**. Before you start, make sure [Node.js](https://nodejs.org/) 18+ is installed (on Windows, install [WSL](https://learn.microsoft.com/en-us/windows/wsl/install) first). Pick your OS and paste each step's commands as a whole.

{% tabs %}
{% tab title="Windows" %}

**Step 1: Install Codex**

```powershell
npm install -g @openai/codex
# Verify the installation — a version number means it worked
codex --version
```

**Step 2: Create the config files**

Paste the whole block into PowerShell. It writes `%USERPROFILE%\.codex\config.toml` and `auth.json` (existing files are overwritten, giving you a clean config):

```powershell
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.codex" | Out-Null

@'
model_provider = "gget"
model = "YOUR_MODEL_ID"
model_reasoning_effort = "high"
disable_response_storage = true
preferred_auth_method = "apikey"

[model_providers.gget]
name = "GGet"
base_url = "https://gget.ai/v1"
wire_api = "responses"
requires_openai_auth = true
'@ | Set-Content -Path "$env:USERPROFILE\.codex\config.toml" -Encoding utf8

@'
{
  "OPENAI_API_KEY": "YOUR_API_KEY"
}
'@ | Set-Content -Path "$env:USERPROFILE\.codex\auth.json" -Encoding utf8
```

Replace `YOUR_MODEL_ID` with the model ID and `YOUR_API_KEY` with an API key copied from the console.

**Step 3: Launch**

```powershell
codex
```

{% endtab %}
{% tab title="macOS" %}

**Step 1: Install Codex**

```bash
npm install -g @openai/codex
# Or use Homebrew
brew install codex

# Verify the installation — a version number means it worked
codex --version
```

**Step 2: Create the config files**

Paste the whole block. It writes `~/.codex/config.toml` and `~/.codex/auth.json` (existing files are overwritten, giving you a clean config):

```bash
mkdir -p ~/.codex

cat > ~/.codex/config.toml <<'EOF'
model_provider = "gget"
model = "YOUR_MODEL_ID"
model_reasoning_effort = "high"
disable_response_storage = true
preferred_auth_method = "apikey"

[model_providers.gget]
name = "GGet"
base_url = "https://gget.ai/v1"
wire_api = "responses"
requires_openai_auth = true
EOF

cat > ~/.codex/auth.json <<'EOF'
{
  "OPENAI_API_KEY": "YOUR_API_KEY"
}
EOF
chmod 600 ~/.codex/auth.json
```

Replace `YOUR_MODEL_ID` with the model ID and `YOUR_API_KEY` with an API key copied from the console.

**Step 3: Launch**

```bash
codex
```

{% endtab %}
{% tab title="Linux / WSL" %}

**Step 1: Install Codex**

```bash
npm install -g @openai/codex

# Verify the installation — a version number means it worked
codex --version
```

**Step 2: Create the config files**

Paste the whole block. It writes `~/.codex/config.toml` and `~/.codex/auth.json` (existing files are overwritten, giving you a clean config):

```bash
mkdir -p ~/.codex

cat > ~/.codex/config.toml <<'EOF'
model_provider = "gget"
model = "YOUR_MODEL_ID"
model_reasoning_effort = "high"
disable_response_storage = true
preferred_auth_method = "apikey"

[model_providers.gget]
name = "GGet"
base_url = "https://gget.ai/v1"
wire_api = "responses"
requires_openai_auth = true
EOF

cat > ~/.codex/auth.json <<'EOF'
{
  "OPENAI_API_KEY": "YOUR_API_KEY"
}
EOF
chmod 600 ~/.codex/auth.json
```

Replace `YOUR_MODEL_ID` with the model ID and `YOUR_API_KEY` with an API key copied from the console.

**Step 3: Launch**

```bash
codex
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
`base_url` must carry the `/v1` suffix. This differs from Claude Code.
{% endhint %}

{% hint style="info" %}
Once the config is written to `~/.codex`, both the Codex CLI and the desktop app pick it up. If you previously signed in with a ChatGPT account, the config above overrides that login with API-key auth. Fully quit any running client and restart it.
{% endhint %}

{% endexpand %}

## 3. Troubleshooting

**404 / model not found**

The `/v1` suffix is missing from `base_url`, or the `model` ID is not available on this site. Check the pricing page for the list of available models.

**401 / authentication failure**

The CLI never saw the key. Confirm `OPENAI_API_KEY` is exported in the current shell (`echo $OPENAI_API_KEY`), or switch to `~/.codex/auth.json`.

**The desktop app ignores the configuration**

The app reads its configuration only at startup. Quit it completely — closing the window is not enough — and relaunch.

**My configuration was overwritten**

The one-click script rewrites `config.toml` and `auth.json`. The originals are kept alongside them as `.bak.<timestamp>` files.

### API Reference

Source: https://gget.ai/docs/api-reference

This page covers all of GGet's endpoints: request parameters, multi-language call examples, response formats, rate limiting, and error codes. After copying an example, replace `YOUR_API_KEY` with your own API key and change `model` to the model ID you want to call.

{% hint style="info" %}
If you want to use this site in command-line tools such as Claude Code or Codex, see the [Claude Code Setup](#claude-code) and [Codex (OpenAI) Setup](#codex), which provide one-click scripts.
{% endhint %}

## 1. Prerequisites

The Base URL is `https://gget.ai`. This site is compatible with both the OpenAI and Anthropic protocols. The two use different authentication headers and paths:

| Protocol  | Request URL                      | Auth Header                                                   |
| --------- | -------------------------------- | ------------------------------------------------------------- |
| OpenAI    | `https://gget.ai/v1/...`      | `Authorization: Bearer YOUR_API_KEY`                          |
| Anthropic | `https://gget.ai/v1/messages` | `x-api-key: YOUR_API_KEY` and `anthropic-version: 2023-06-01` |

Install the official SDK:

{% tabs %}
{% tab title="Python" %}

```bash
pip install openai      # OpenAI protocol
pip install anthropic   # Anthropic protocol
```

{% endtab %}
{% tab title="Node.js" %}

```bash
npm install openai            # OpenAI protocol
npm install @anthropic-ai/sdk # Anthropic protocol
```

{% endtab %}
{% endtabs %}

## 2. Rate Limiting

To ensure service quality for all users, the API imposes the following rate limits on each account:

| Limit Type                | Default Quota        | Description                     |
| ------------------------- | -------------------- | ------------------------------- |
| RPM (Requests Per Minute) | 300 requests/min     | Counted independently per model |
| RPD (Requests Per Day)    | 216,000 requests/day | Shared across all models        |
| TPM (Tokens Per Minute)   | 6,144,000 tokens/min | Counted independently per model |

**Rate Limiting Details:**

- Rate limits use a token bucket algorithm; quota recovers continuously and short burst requests are supported
- RPM and TPM are counted independently per model — even if Model A's quota is exhausted, you can still make requests to Model B normally
- RPD is an account-level global quota, consumed jointly by all model requests
- TPM pre-reserves quota based on estimated token count at request initiation, then auto-corrects based on actual usage after the request completes

**When Rate Limited:**

- Returns HTTP `429 Too Many Requests`
- The `Retry-After` response header indicates the suggested wait time in seconds before retrying
- The `X-RateLimit-Limit-Requests` / `X-RateLimit-Remaining-Requests` headers reflect the current RPM quota
- The `X-RateLimit-Limit-Tokens` / `X-RateLimit-Remaining-Tokens` headers reflect the current TPM quota

## 3. Anthropic Messages

`POST https://gget.ai/v1/messages`

> Use the Anthropic native format to call Claude series models. Note that the auth header is `x-api-key`, and `anthropic-version` is required.

### 3.1 Request Parameters

| Parameter    | Type    | Description                                         | Required |
| ------------ | ------- | --------------------------------------------------- | -------- |
| `model`      | string  | Model ID                                            | ✓        |
| `messages`   | array   | Conversation message array                          | ✓        |
| `max_tokens` | integer | Maximum output tokens                               | ✓        |
| `system`     | string  | System prompt                                       |          |
| `stream`     | boolean | Whether to enable streaming output, default `false` |          |

For more parameters, see the official Anthropic documentation.

### 3.2 Plain Text

{% tabs %}
{% tab title="cURL" %}

```bash
curl https://gget.ai/v1/messages \
  -H "x-api-key: YOUR_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-opus-4-6",
    "max_tokens": 1024,
    "system": "You are a professional coding assistant.",
    "messages": [
      { "role": "user", "content": "Write a quicksort in Python for me." }
    ]
  }'
```

{% endtab %}
{% tab title="Python" %}

```python
import anthropic

client = anthropic.Anthropic(
    api_key="YOUR_API_KEY",
    base_url="https://gget.ai",
)

message = client.messages.create(
    model="claude-opus-4-6",
    max_tokens=1024,
    system="You are a professional coding assistant.",
    messages=[{"role": "user", "content": "Write a quicksort in Python for me."}],
)

print(message.content[0].text)
```

{% endtab %}
{% tab title="Node.js" %}

```typescript
import Anthropic from '@anthropic-ai/sdk'

const client = new Anthropic({
  apiKey: 'YOUR_API_KEY',
  baseURL: 'https://gget.ai',
})

const message = await client.messages.create({
  model: 'claude-opus-4-6',
  max_tokens: 1024,
  system: 'You are a professional coding assistant.',
  messages: [{ role: 'user', content: 'Write a quicksort in Python for me.' }],
})

console.log(message.content[0].text)
```

{% endtab %}
{% tab title="Go" %}

```go
package main

import (
  "bytes"
  "encoding/json"
  "fmt"
  "io"
  "net/http"
)

func main() {
  payload := map[string]any{
    "model":      "claude-opus-4-6",
    "max_tokens": 1024,
    "messages": []map[string]string{
      {"role": "user", "content": "Write a quicksort in Python for me."},
    },
  }
  body, _ := json.Marshal(payload)

  req, _ := http.NewRequest("POST", "https://gget.ai/v1/messages", bytes.NewBuffer(body))
  req.Header.Set("x-api-key", "YOUR_API_KEY")
  req.Header.Set("anthropic-version", "2023-06-01")
  req.Header.Set("Content-Type", "application/json")

  resp, _ := http.DefaultClient.Do(req)
  defer resp.Body.Close()

  result, _ := io.ReadAll(resp.Body)
  fmt.Println(string(result))
}
```

{% endtab %}
{% tab title="Java" %}

```java
import okhttp3.*;
import org.json.*;

public class Main {
  public static void main(String[] args) throws Exception {
    OkHttpClient client = new OkHttpClient();

    String body = new JSONObject()
      .put("model", "claude-opus-4-6")
      .put("max_tokens", 1024)
      .put("messages", new JSONArray()
        .put(new JSONObject()
          .put("role", "user")
          .put("content", "Write a quicksort in Python for me.")))
      .toString();

    Request request = new Request.Builder()
      .url("https://gget.ai/v1/messages")
      .post(RequestBody.create(body, MediaType.get("application/json")))
      .addHeader("x-api-key", "YOUR_API_KEY")
      .addHeader("anthropic-version", "2023-06-01")
      .addHeader("Content-Type", "application/json")
      .build();

    try (Response response = client.newCall(request).execute()) {
      JSONObject result = new JSONObject(response.body().string());
      System.out.println(
        result.getJSONArray("content").getJSONObject(0).getString("text")
      );
    }
  }
}
```

{% endtab %}
{% endtabs %}

### 3.3 Text + Image

Anthropic's image block uses `source` to describe where the image comes from, and the base64 mode also requires an explicit `media_type`.

{% tabs %}
{% tab title="cURL" %}

```bash
curl https://gget.ai/v1/messages \
  -H "x-api-key: YOUR_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-opus-4-6",
    "max_tokens": 1024,
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "image",
            "source": { "type": "url", "url": "https://gget.ai/logo.png" }
          },
          { "type": "text", "text": "What is in this image? Describe it briefly." }
        ]
      }
    ]
  }'
```

{% endtab %}
{% tab title="Python" %}

```python
import base64
import httpx
import anthropic

client = anthropic.Anthropic(
    api_key="YOUR_API_KEY",
    base_url="https://gget.ai",
)

image_data = base64.b64encode(
    httpx.get("https://gget.ai/logo.png").content
).decode()

message = client.messages.create(
    model="claude-opus-4-6",
    max_tokens=1024,
    messages=[
        {
            "role": "user",
            "content": [
                {
                    "type": "image",
                    "source": {
                        "type": "base64",
                        "media_type": "image/png",
                        "data": image_data,
                    },
                },
                {"type": "text", "text": "What is in this image? Describe it briefly."},
            ],
        }
    ],
)

print(message.content[0].text)
```

{% endtab %}
{% tab title="Node.js" %}

```typescript
import Anthropic from '@anthropic-ai/sdk'

const client = new Anthropic({
  apiKey: 'YOUR_API_KEY',
  baseURL: 'https://gget.ai',
})

const res = await fetch('https://gget.ai/logo.png')
const imageData = Buffer.from(await res.arrayBuffer()).toString('base64')

const message = await client.messages.create({
  model: 'claude-opus-4-6',
  max_tokens: 1024,
  messages: [
    {
      role: 'user',
      content: [
        {
          type: 'image',
          source: { type: 'base64', media_type: 'image/png', data: imageData },
        },
        { type: 'text', text: 'What is in this image? Describe it briefly.' },
      ],
    },
  ],
})

console.log(message.content[0].text)
```

{% endtab %}
{% endtabs %}

### 3.4 Streaming Output

{% tabs %}
{% tab title="cURL" %}

```bash
curl -N https://gget.ai/v1/messages \
  -H "x-api-key: YOUR_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -H "Accept: text/event-stream" \
  -d '{
    "model": "claude-opus-4-6",
    "max_tokens": 1024,
    "stream": true,
    "messages": [
      { "role": "user", "content": "Write a short essay about AI." }
    ]
  }'
```

{% endtab %}
{% tab title="Python" %}

```python
import anthropic

client = anthropic.Anthropic(
    api_key="YOUR_API_KEY",
    base_url="https://gget.ai",
)

with client.messages.stream(
    model="claude-opus-4-6",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Write a short essay about AI."}],
) as stream:
    for text in stream.text_stream:
        print(text, end="", flush=True)
```

{% endtab %}
{% tab title="Node.js" %}

```typescript
import Anthropic from '@anthropic-ai/sdk'

const client = new Anthropic({
  apiKey: 'YOUR_API_KEY',
  baseURL: 'https://gget.ai',
})

const stream = await client.messages.stream({
  model: 'claude-opus-4-6',
  max_tokens: 1024,
  messages: [{ role: 'user', content: 'Write a short essay about AI.' }],
})

for await (const chunk of stream) {
  if (
    chunk.type === 'content_block_delta' &&
    chunk.delta.type === 'text_delta'
  ) {
    process.stdout.write(chunk.delta.text)
  }
}
```

{% endtab %}
{% endtabs %}

### 3.5 Response Example

{% tabs %}
{% tab title="Non-streaming" %}

```json
{
  "content": [
    {
      "type": "text",
      "text": "Hello! Nice to meet you 😊 How can I help you?"
    }
  ],
  "id": "msg_01PXFpjoBEXMn1yEGDdp8RrH",
  "model": "claude-opus-4-6",
  "role": "assistant",
  "stop_details": null,
  "stop_reason": "end_turn",
  "stop_sequence": null,
  "type": "message",
  "usage": {
    "input_tokens": 10,
    "cache_creation_input_tokens": 0,
    "cache_read_input_tokens": 0,
    "cache_creation": {
      "ephemeral_5m_input_tokens": 0,
      "ephemeral_1h_input_tokens": 0
    },
    "output_tokens": 31,
    "service_tier": "standard",
    "inference_geo": "not_available"
  }
}
```

{% endtab %}
{% tab title="Streaming" %}

- The response is returned chunk by chunk in SSE format, example:

```
event: message_start
data: {"type":"message_start","message":{"id":"msg_01...","type":"message","role":"assistant","model":"claude-opus-4-6","stop_reason":null,"usage":{"input_tokens":10,"output_tokens":0}}}

event: content_block_delta
data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Hello"}}

event: message_delta
data: {"type":"message_delta","delta":{"stop_reason":"end_turn"},"usage":{"output_tokens":5}}

event: message_stop
data: {"type":"message_stop"}
```

{% endtab %}
{% endtabs %}

## 4. OpenAI Responses

`POST https://gget.ai/v1/responses`

> The next-generation OpenAI endpoint, suited for text conversations, image understanding, and streaming output.

### 4.1 Request Parameters

| Parameter | Type            | Description                                         | Required |
| --------- | --------------- | --------------------------------------------------- | -------- |
| `model`   | string          | Model ID                                            | ✓        |
| `input`   | string \| array | User input content                                  | ✓        |
| `stream`  | boolean         | Whether to enable streaming output, default `false` |          |

For more parameters, see the official OpenAI documentation.

### 4.2 Plain Text

{% tabs %}
{% tab title="cURL" %}

```bash
curl https://gget.ai/v1/responses \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.3-codex",
    "input": "Write a quicksort in Python for me."
  }'
```

{% endtab %}
{% tab title="Python" %}

```python
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://gget.ai/v1",
)

response = client.responses.create(
    model="gpt-5.3-codex",
    input="Write a quicksort in Python for me.",
)

print(response.output_text)
```

{% endtab %}
{% tab title="Node.js" %}

```js
import OpenAI from 'openai'

const client = new OpenAI({
  apiKey: 'YOUR_API_KEY',
  baseURL: 'https://gget.ai/v1',
})

const response = await client.responses.create({
  model: 'gpt-5.3-codex',
  input: 'Write a quicksort in Python for me.',
})

console.log(response.output_text)
```

{% endtab %}
{% tab title="Go" %}

```go
package main

import (
  "bytes"
  "encoding/json"
  "fmt"
  "io"
  "net/http"
)

func main() {
  payload := map[string]any{
    "model": "gpt-5.3-codex",
    "input": "Write a quicksort in Python for me.",
  }
  body, _ := json.Marshal(payload)

  req, _ := http.NewRequest("POST", "https://gget.ai/v1/responses", bytes.NewBuffer(body))
  req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
  req.Header.Set("Content-Type", "application/json")

  resp, _ := http.DefaultClient.Do(req)
  defer resp.Body.Close()

  result, _ := io.ReadAll(resp.Body)
  fmt.Println(string(result))
}
```

{% endtab %}
{% tab title="Java" %}

```java
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.responses.Response;
import com.openai.models.responses.ResponseCreateParams;

public class Main {
    public static void main(String[] args) {
        OpenAIClient client = OpenAIOkHttpClient.builder()
                .apiKey("YOUR_API_KEY")
                .baseUrl("https://gget.ai/v1")
                .build();

        ResponseCreateParams params = ResponseCreateParams.builder()
                .model("gpt-5.3-codex")
                .input("Write a quicksort in Python for me.")
                .build();

        Response response = client.responses().create(params);
        System.out.println(response.outputText());
    }
}
```

{% endtab %}
{% endtabs %}

### 4.3 Text + Image

You can pass a public image URL, or inline base64 data prefixed with `data:`.

{% tabs %}
{% tab title="cURL" %}

```bash
curl https://gget.ai/v1/responses \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.3-codex",
    "input": [
      {
        "role": "user",
        "content": [
          { "type": "input_text", "text": "What is in this image? Describe it briefly." },
          { "type": "input_image", "image_url": "https://gget.ai/logo.png" }
        ]
      }
    ]
  }'
```

{% endtab %}
{% tab title="Python" %}

```python
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://gget.ai/v1",
)

response = client.responses.create(
    model="gpt-5.3-codex",
    input=[
        {
            "role": "user",
            "content": [
                {"type": "input_text", "text": "What is in this image? Describe it briefly."},
                {"type": "input_image", "image_url": "https://gget.ai/logo.png"},
            ],
        }
    ],
)

print(response.output_text)
```

{% endtab %}
{% tab title="Node.js" %}

```js
import OpenAI from 'openai'

const client = new OpenAI({
  apiKey: 'YOUR_API_KEY',
  baseURL: 'https://gget.ai/v1',
})

const response = await client.responses.create({
  model: 'gpt-5.3-codex',
  input: [
    {
      role: 'user',
      content: [
        {
          type: 'input_text',
          text: 'What is in this image? Describe it briefly.',
        },
        { type: 'input_image', image_url: 'https://gget.ai/logo.png' },
      ],
    },
  ],
})

console.log(response.output_text)
```

{% endtab %}
{% endtabs %}

### 4.4 Streaming Output

{% tabs %}
{% tab title="cURL" %}

```bash
curl -N https://gget.ai/v1/responses \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: text/event-stream" \
  -d '{
    "model": "gpt-5.3-codex",
    "input": "Write a short essay about AI.",
    "stream": true
  }'
```

{% endtab %}
{% tab title="Python" %}

```python
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://gget.ai/v1",
)

with client.responses.stream(
    model="gpt-5.3-codex",
    input="Write a short essay about AI.",
) as stream:
    for event in stream:
        if event.type == "response.output_text.delta":
            print(event.delta, end="", flush=True)
```

{% endtab %}
{% tab title="Node.js" %}

```js
import OpenAI from 'openai'

const client = new OpenAI({
  apiKey: 'YOUR_API_KEY',
  baseURL: 'https://gget.ai/v1',
})

const stream = await client.responses.create({
  model: 'gpt-5.3-codex',
  input: 'Write a short essay about AI.',
  stream: true,
})

for await (const event of stream) {
  if (event.type === 'response.output_text.delta') {
    process.stdout.write(event.delta)
  }
}
```

{% endtab %}
{% endtabs %}

### 4.5 Response Example

{% tabs %}
{% tab title="Non-streaming" %}

```json
{
  "id": "resp_xxxxx",
  "object": "response",
  "model": "gpt-5.3-codex",
  "output_text": "def quicksort(arr):\n    if len(arr) <= 1:\n        return arr\n    ...",
  "usage": {
    "input_tokens": 12,
    "output_tokens": 86,
    "total_tokens": 98
  }
}
```

{% endtab %}
{% tab title="Streaming" %}

- The response is returned chunk by chunk in SSE format, example:

```
event: response.output_text.delta
data: {"type":"response.output_text.delta","delta":"Hello"}

event: response.output_text.done
data: {"type":"response.output_text.done","text":"Hello! How can I help you?"}

event: response.completed
data: {"type":"response.completed","response":{"id":"resp_xxxxx","status":"completed","output_text":"Hello! How can I help you?","usage":{"input_tokens":5,"output_tokens":12,"total_tokens":17}}}
```

{% endtab %}
{% endtabs %}

## 5. OpenAI Chat Completions

`POST https://gget.ai/v1/chat/completions`

> Compatible with the traditional OpenAI Chat format, ideal for smoothly migrating existing clients.

### 5.1 Request Parameters

| Parameter  | Type    | Description                                         | Required |
| ---------- | ------- | --------------------------------------------------- | -------- |
| `model`    | string  | Model ID                                            | ✓        |
| `messages` | array   | Conversation message array                          | ✓        |
| `stream`   | boolean | Whether to enable streaming output, default `false` |          |

### 5.2 Plain Text

{% tabs %}
{% tab title="cURL" %}

```bash
curl https://gget.ai/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.3-codex",
    "messages": [
      { "role": "user", "content": "Write a quicksort in Python for me." }
    ]
  }'
```

{% endtab %}
{% tab title="Python" %}

```python
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://gget.ai/v1",
)

completion = client.chat.completions.create(
    model="gpt-5.3-codex",
    messages=[{"role": "user", "content": "Write a quicksort in Python for me."}],
)

print(completion.choices[0].message.content)
```

{% endtab %}
{% tab title="Node.js" %}

```js
import OpenAI from 'openai'

const client = new OpenAI({
  apiKey: 'YOUR_API_KEY',
  baseURL: 'https://gget.ai/v1',
})

const completion = await client.chat.completions.create({
  model: 'gpt-5.3-codex',
  messages: [{ role: 'user', content: 'Write a quicksort in Python for me.' }],
})

console.log(completion.choices[0].message.content)
```

{% endtab %}
{% endtabs %}

### 5.3 Text + Image

Note that in Chat Completions the `image_url` is an object rather than a string — this differs from Responses.

{% tabs %}
{% tab title="cURL" %}

```bash
curl https://gget.ai/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.3-codex",
    "messages": [
      {
        "role": "user",
        "content": [
          { "type": "text", "text": "What is in this image? Describe it briefly." },
          {
            "type": "image_url",
            "image_url": { "url": "https://gget.ai/logo.png" }
          }
        ]
      }
    ]
  }'
```

{% endtab %}
{% tab title="Python" %}

```python
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://gget.ai/v1",
)

completion = client.chat.completions.create(
    model="gpt-5.3-codex",
    messages=[
        {
            "role": "user",
            "content": [
                {"type": "text", "text": "What is in this image? Describe it briefly."},
                {
                    "type": "image_url",
                    "image_url": {"url": "https://gget.ai/logo.png"},
                },
            ],
        }
    ],
)

print(completion.choices[0].message.content)
```

{% endtab %}
{% tab title="Node.js" %}

```js
import OpenAI from 'openai'

const client = new OpenAI({
  apiKey: 'YOUR_API_KEY',
  baseURL: 'https://gget.ai/v1',
})

const completion = await client.chat.completions.create({
  model: 'gpt-5.3-codex',
  messages: [
    {
      role: 'user',
      content: [
        { type: 'text', text: 'What is in this image? Describe it briefly.' },
        {
          type: 'image_url',
          image_url: { url: 'https://gget.ai/logo.png' },
        },
      ],
    },
  ],
})

console.log(completion.choices[0].message.content)
```

{% endtab %}
{% endtabs %}

## 6. Image Generation

`POST https://gget.ai/v1/images/generations`

> Generate images using OpenAI-compatible format. The request header must include `Authorization: Bearer YOUR_API_KEY` or `x-api-key: YOUR_API_KEY`.

### 6.1 Request Parameters

| Parameter         | Type    | Description                                                                       | Required |
| ----------------- | ------- | --------------------------------------------------------------------------------- | -------- |
| `model`           | string  | Model ID, e.g. `gpt-image-2`                                                      | ✓        |
| `prompt`          | string  | Image description prompt, maximum 4000 characters                                 | ✓        |
| `n`               | integer | Number of images to generate, default 1                                           |          |
| `size`            | string  | Image size, e.g. `1024x1024`, `1792x1024`                                         |          |
| `quality`         | string  | Image quality, values depend on the model                                         |          |
| `response_format` | string  | Response format: `url` (default, returns image URL) / `b64_json` (returns Base64) |          |

### 6.2 Example Request

{% tabs %}
{% tab title="cURL" %}

```bash
curl https://gget.ai/v1/images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "An orange cat sitting on a windowsill watching the snow, watercolor style",
    "n": 1,
    "size": "1024x1024"
  }'
```

{% endtab %}
{% tab title="Python" %}

```python
import base64
from pathlib import Path
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://gget.ai/v1",
)

result = client.images.generate(
    model="gpt-image-2",
    prompt="An orange cat sitting on a windowsill watching the snow, watercolor style",
    size="1024x1024",
)

Path("output.png").write_bytes(base64.b64decode(result.data[0].b64_json))
```

{% endtab %}
{% tab title="Node.js" %}

```js
import { writeFileSync } from 'node:fs'
import OpenAI from 'openai'

const client = new OpenAI({
  apiKey: 'YOUR_API_KEY',
  baseURL: 'https://gget.ai/v1',
})

const result = await client.images.generate({
  model: 'gpt-image-2',
  prompt:
    'An orange cat sitting on a windowsill watching the snow, watercolor style',
  size: '1024x1024',
})

writeFileSync('output.png', Buffer.from(result.data[0].b64_json, 'base64'))
```

{% endtab %}
{% endtabs %}

### 6.3 Response Example

{% tabs %}
{% tab title="Returns URL" %}

```json
{
  "created": 1718200000,
  "data": [
    {
      "url": "https://example.com/generated-image.png",
      "b64_json": "",
      "revised_prompt": "A detailed watercolor painting of an orange tabby cat sitting on a windowsill watching the snow..."
    }
  ]
}
```

{% endtab %}
{% tab title="Returns Base64" %}

```json
{
  "created": 1718200000,
  "data": [
    {
      "url": "",
      "b64_json": "iVBORw0KGgoAAAANSUhEUgAA...",
      "revised_prompt": "A detailed watercolor painting of an orange tabby cat sitting on a windowsill watching the snow..."
    }
  ]
}
```

{% endtab %}
{% endtabs %}

### 6.4 Notes

- This endpoint is **non-streaming**; you must wait for the server to finish generating before receiving the result
- Image generation takes a relatively long time (usually 10-30 seconds), it is recommended to set a reasonable client timeout
- The `url` is valid for 24 hours, after which the link expires
- `revised_prompt` is the prompt optimized by the model based on your input

## 7. Image Editing

`POST https://gget.ai/v1/images/edits`

> Upload an image and modify it according to a prompt. This endpoint uses `multipart/form-data`, not JSON.

{% tabs %}
{% tab title="cURL" %}

```bash
curl https://gget.ai/v1/images/edits \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F model="gpt-image-2" \
  -F image="@input.png" \
  -F prompt="Replace the background with a starry sky"
```

{% endtab %}
{% tab title="Python" %}

```python
import base64
from pathlib import Path
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://gget.ai/v1",
)

with open("input.png", "rb") as image:
    result = client.images.edit(
        model="gpt-image-2",
        image=image,
        prompt="Replace the background with a starry sky",
    )

Path("output.png").write_bytes(base64.b64decode(result.data[0].b64_json))
```

{% endtab %}
{% tab title="Node.js" %}

```js
import { createReadStream, writeFileSync } from 'node:fs'
import OpenAI from 'openai'

const client = new OpenAI({
  apiKey: 'YOUR_API_KEY',
  baseURL: 'https://gget.ai/v1',
})

const result = await client.images.edit({
  model: 'gpt-image-2',
  image: createReadStream('input.png'),
  prompt: 'Replace the background with a starry sky',
})

writeFileSync('output.png', Buffer.from(result.data[0].b64_json, 'base64'))
```

{% endtab %}
{% endtabs %}

The response format is the same as image generation.

## 8. Video Generation

`POST https://gget.ai/v1/video/generations`

> Video generation is an **asynchronous task**: submitting returns a task ID immediately; poll the status, then download the finished clip.

| Step              | Method & Path                      | Description                                     |
| ----------------- | ---------------------------------- | ----------------------------------------------- |
| 1. Submit task    | `POST /v1/video/generations`       | Also accepts the OpenAI-style `POST /v1/videos` |
| 2. Poll status    | `GET /v1/videos/{task_id}`         | Poll until `completed` or `failed`              |
| 3. Download video | `GET /v1/videos/{task_id}/content` | Returns the clip as a `video/mp4` file stream   |

### 8.1 Submit a Task

| Parameter  | Type    | Description                                                                                                | Required |
| ---------- | ------- | ---------------------------------------------------------------------------------------------------------- | -------- |
| `model`    | string  | Video model ID                                                                                             | ✓        |
| `prompt`   | string  | Text prompt describing the video                                                                           | ✓        |
| `image`    | string  | First-frame image (URL or Base64). Provide it for image-to-video; omit it for text-to-video                |          |
| `images`   | array   | Multiple image inputs (supported by some models)                                                           |          |
| `duration` | integer | Video duration in seconds                                                                                  |          |
| `size`     | string  | Resolution such as `720x1280` (used by Sora-family models)                                                 |          |
| `metadata` | object  | Vendor-specific parameters (e.g. `resolution`, `ratio`, `watermark`), passed through to the upstream as-is |          |

{% hint style="warning" %}
Vendor-specific parameters such as resolution and aspect ratio MUST go inside the `metadata` object — unknown top-level fields in the request body are ignored. Check the vendor's documentation for the keys each model supports.
{% endhint %}

{% tabs %}
{% tab title="cURL" %}

```bash
# Image-to-video (i2v); for text-to-video (t2v) simply drop the image field
curl https://gget.ai/v1/video/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "dreamina-seedance-2-0-260128",
    "prompt": "A cat sitting on a table, anime style",
    "image": "https://picsum.photos/800/600",
    "duration": 5,
    "metadata": { "resolution": "720p", "ratio": "9:16" }
  }'
```

{% endtab %}
{% tab title="Python" %}

```python
import requests

resp = requests.post(
    "https://gget.ai/v1/video/generations",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={
        "model": "dreamina-seedance-2-0-260128",
        "prompt": "A cat sitting on a table, anime style",
        "image": "https://picsum.photos/800/600",
        "duration": 5,
        "metadata": {"resolution": "720p", "ratio": "9:16"},
    },
)

task_id = resp.json()["id"]
print(task_id)
```

{% endtab %}
{% tab title="Node.js" %}

```js
const resp = await fetch('https://gget.ai/v1/video/generations', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    model: 'dreamina-seedance-2-0-260128',
    prompt: 'A cat sitting on a table, anime style',
    image: 'https://picsum.photos/800/600',
    duration: 5,
    metadata: { resolution: '720p', ratio: '9:16' },
  }),
})

const { id: taskId } = await resp.json()
console.log(taskId)
```

{% endtab %}
{% endtabs %}

A successful submission immediately returns the task object with `status` set to `queued`:

```json
{
  "id": "task_bub5kqucQqheYFejRggZhqvd0vadpX7n",
  "object": "video",
  "model": "dreamina-seedance-2-0-260128",
  "status": "queued",
  "progress": 0,
  "created_at": 1784105592
}
```

### 8.2 Poll Status

`GET https://gget.ai/v1/videos/{task_id}`

`status` moves through `queued` → `in_progress` → `completed` / `failed`, and `progress` is an integer from 0 to 100. Polling every ~5 seconds is recommended.

{% tabs %}
{% tab title="cURL" %}

```bash
TASK_ID="task_bub5kqucQqheYFejRggZhqvd0vadpX7n"

curl https://gget.ai/v1/videos/$TASK_ID \
  -H "Authorization: Bearer YOUR_API_KEY"
```

{% endtab %}
{% tab title="Python" %}

```python
import requests

task_id = "task_bub5kqucQqheYFejRggZhqvd0vadpX7n"

status = requests.get(
    f"https://gget.ai/v1/videos/{task_id}",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
).json()

print(status["status"], status["progress"])
```

{% endtab %}
{% tab title="Node.js" %}

```js
const taskId = 'task_bub5kqucQqheYFejRggZhqvd0vadpX7n'

const status = await fetch(`https://gget.ai/v1/videos/${taskId}`, {
  headers: { Authorization: 'Bearer YOUR_API_KEY' },
}).then((r) => r.json())

console.log(status.status, status.progress)
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="In progress" %}

```json
{
  "id": "task_bub5kqucQqheYFejRggZhqvd0vadpX7n",
  "object": "video",
  "model": "dreamina-seedance-2-0-260128",
  "status": "in_progress",
  "progress": 42,
  "created_at": 1784105592
}
```

{% endtab %}
{% tab title="Completed" %}

```json
{
  "id": "task_bub5kqucQqheYFejRggZhqvd0vadpX7n",
  "object": "video",
  "model": "dreamina-seedance-2-0-260128",
  "status": "completed",
  "progress": 100,
  "created_at": 1784105592,
  "completed_at": 1784105713,
  "seconds": "5"
}
```

{% endtab %}
{% tab title="Failed" %}

```json
{
  "id": "task_bub5kqucQqheYFejRggZhqvd0vadpX7n",
  "object": "video",
  "model": "dreamina-seedance-2-0-260128",
  "status": "failed",
  "progress": 0,
  "created_at": 1784105592,
  "error": {
    "code": "OutputVideoSensitiveContentDetected",
    "message": "The output video may contain sensitive information."
  }
}
```

{% endtab %}
{% endtabs %}

### 8.3 Download the Video

`GET https://gget.ai/v1/videos/{task_id}/content`

Once `status` is `completed`, download the mp4 from this endpoint (the server proxies the file stream):

{% tabs %}
{% tab title="cURL" %}

```bash
TASK_ID="task_bub5kqucQqheYFejRggZhqvd0vadpX7n"

curl -L https://gget.ai/v1/videos/$TASK_ID/content \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -o output.mp4
```

{% endtab %}
{% tab title="Python" %}

```python
import requests

task_id = "task_bub5kqucQqheYFejRggZhqvd0vadpX7n"

video = requests.get(
    f"https://gget.ai/v1/videos/{task_id}/content",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
)

with open("output.mp4", "wb") as f:
    f.write(video.content)
```

{% endtab %}
{% tab title="Node.js" %}

```js
import { writeFileSync } from 'node:fs'

const taskId = 'task_bub5kqucQqheYFejRggZhqvd0vadpX7n'

const video = await fetch(`https://gget.ai/v1/videos/${taskId}/content`, {
  headers: { Authorization: 'Bearer YOUR_API_KEY' },
})

writeFileSync('output.mp4', Buffer.from(await video.arrayBuffer()))
```

{% endtab %}
{% endtabs %}

### 8.4 Full Polling Example

{% tabs %}
{% tab title="Python" %}

```python
import time
import requests

BASE = "https://gget.ai"
HEADERS = {"Authorization": "Bearer YOUR_API_KEY"}

task = requests.post(
    f"{BASE}/v1/video/generations",
    headers=HEADERS,
    json={
        "model": "dreamina-seedance-2-0-260128",
        "prompt": "A cat sitting on a table, anime style",
        "image": "https://picsum.photos/800/600",
        "duration": 5,
        "metadata": {"resolution": "720p", "ratio": "9:16"},
    },
).json()

while True:
    status = requests.get(f"{BASE}/v1/videos/{task['id']}", headers=HEADERS).json()
    if status["status"] in ("completed", "failed"):
        break
    time.sleep(5)

if status["status"] == "completed":
    video = requests.get(f"{BASE}/v1/videos/{task['id']}/content", headers=HEADERS)
    with open("output.mp4", "wb") as f:
        f.write(video.content)
else:
    print(status["error"])
```

{% endtab %}
{% tab title="Node.js" %}

```js
import { writeFileSync } from 'node:fs'

const BASE = 'https://gget.ai'
const HEADERS = { Authorization: 'Bearer YOUR_API_KEY' }

const task = await fetch(`${BASE}/v1/video/generations`, {
  method: 'POST',
  headers: { ...HEADERS, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    model: 'dreamina-seedance-2-0-260128',
    prompt: 'A cat sitting on a table, anime style',
    image: 'https://picsum.photos/800/600',
    duration: 5,
    metadata: { resolution: '720p', ratio: '9:16' },
  }),
}).then((r) => r.json())

let status
do {
  await new Promise((r) => setTimeout(r, 5000))
  status = await fetch(`${BASE}/v1/videos/${task.id}`, {
    headers: HEADERS,
  }).then((r) => r.json())
} while (status.status === 'queued' || status.status === 'in_progress')

if (status.status === 'completed') {
  const video = await fetch(`${BASE}/v1/videos/${task.id}/content`, {
    headers: HEADERS,
  })
  writeFileSync('output.mp4', Buffer.from(await video.arrayBuffer()))
} else {
  console.error(status.error)
}
```

{% endtab %}
{% endtabs %}

### 8.5 Notes

- Generation takes anywhere from tens of seconds to several minutes — do not wait for it synchronously in a single HTTP request
- Download promptly after completion; the download endpoint proxies the file server-side, so you never deal with upstream URL expiry
- Use `GET /v1/models` for the authoritative list of available video models

## 9. Query Available Models

`GET https://gget.ai/v1/models`

### 9.1 Example Request

{% tabs %}
{% tab title="Anthropic protocol" %}

```bash
curl https://gget.ai/v1/models \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY"
```

{% endtab %}
{% tab title="OpenAI protocol" %}

```bash
curl https://gget.ai/v1/models \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

{% endtab %}
{% endtabs %}

### 9.2 Response Example

{% tabs %}
{% tab title="Anthropic protocol" %}

```json
{
  "data": [
    {
      "id": "claude-haiku-4-5-20251001",
      "type": "model",
      "display_name": "Claude Haiku 4.5"
    },
    {
      "id": "claude-opus-4-6",
      "type": "model",
      "display_name": "Claude Opus 4.6"
    },
    {
      "id": "claude-sonnet-4-6",
      "type": "model",
      "display_name": "Claude Sonnet 4.6"
    }
  ],
  "has_more": false,
  "first_id": "claude-haiku-4-5-20251001",
  "last_id": "claude-sonnet-4-6"
}
```

{% endtab %}
{% tab title="OpenAI protocol" %}

```json
{
  "data": [
    {
      "id": "gpt-5.3-codex",
      "type": "model",
      "display_name": "GPT-5.3 Codex"
    },
    {
      "id": "gpt-5.5",
      "type": "model",
      "display_name": "GPT-5.5"
    }
  ],
  "has_more": false,
  "first_id": "gpt-5.3-codex",
  "last_id": "gpt-5.5"
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
It is recommended to use the results returned by this endpoint to get the latest available model names.
{% endhint %}

## 10. Error Codes

| HTTP Status Code | Meaning                                                                                               | Example Error Message                          |
| ---------------- | ----------------------------------------------------------------------------------------------------- | ---------------------------------------------- |
| 400              | Request body could not be read or parsed.                                                             | `请求体解析失败: unexpected end of JSON input` |
| 400              | The requested model does not exist or is currently unavailable.                                       | `The model 'xxx' does not exist`               |
| 400              | Upstream provider returned 400; request parameters rejected by upstream; original response forwarded. | _(forwards upstream original response body)_   |
| 401              | Request does not include an API Key (pass via `x-api-key` or `Authorization: Bearer`).                | `Missing API Key`                              |
| 401              | API Key does not exist, is malformed, or is not registered.                                           | `Invalid API Key`                              |
| 402              | User balance is insufficient to cover the estimated cost of this request.                             | `余额不足: balance not enough`                 |
| 403              | API Key has been disabled or expired.                                                                 | `Key disabled or expired`                      |
| 403              | User account has been frozen or disabled.                                                             | `account suspended: frozen`                    |
| 413              | Request body exceeds the maximum allowed size.                                                        | `请求体过大`                                   |
| 429              | Request rate too high.                                                                                | `rate limit exceeded`                          |

### 10.1 Additional Notes

- When rate limited (429), the response will include the following auxiliary headers:

| Response Header                  | Description                          |
| -------------------------------- | ------------------------------------ |
| `Retry-After`                    | Suggested retry wait time in seconds |
| `X-RateLimit-Limit-Requests`     | RPM limit                            |
| `X-RateLimit-Remaining-Requests` | RPM remaining                        |
| `X-RateLimit-Limit-Tokens`       | TPM limit                            |
| `X-RateLimit-Remaining-Tokens`   | TPM remaining quota                  |

### FAQ

Source: https://gget.ai/docs/faq

Q: What's the difference between GGet and calling the official API directly?

A: GGet is an API proxy platform with carefully curated channels, guaranteed model quality, no intelligence degradation and no dilution, primarily addressing the following pain points:

- No credit card required — pay with Alipay
- Access top-tier models like Claude and Codex, manage multiple providers with a single API Key

---

Q: Which models and protocols are supported?

A: The platform supports the **Claude series** (Anthropic Messages API format) and the **Codex series** (OpenAI Responses API format). See [Model Square](/pricing) for the complete model list.

---

Q: What are the pricing details?

A: All models are priced at 20% off the official price. Stack with top-up bonuses to enjoy as low as 40% off the official price. Plus various limited-time promotional discounts — stack discounts on top of discounts for incredible value! Check model unit prices at [Model Square](/pricing) and available promotions at [Quota Management](/dashboard).

---

Q: How is billing calculated?

A: Billed by actual token consumption, with billing rules consistent with the official ones. You can check real-time token consumption and cost details for each API call in [Usage Logs](/usage-logs/common), with transparent and controllable billing.

---

Q: Is the service secure to use?

A: We take user data security very seriously:

1. End-to-end encryption: All data transmission goes through HTTPS encrypted channels to prevent man-in-the-middle attacks
2. Privacy protection: Strict compliance with relevant privacy regulations, see [Privacy Policy](/privacy-policy) for details

---

Q: Do bonus credits have an expiration date?

A: Top-up bonus credits and redemption credits are **permanently valid**; sign-up bonus credits expire in **7 days**; referral reward credits expire in **30 days**, after which the bonus credits are cleared.

---

Q: My account is frozen during a refund process. How can I get in touch?

A: For urgent issues while your account is frozen, please email <> to explain your situation, and we will handle it manually.

---

Q: What should I do if my API Key is leaked?

A: Immediately log in to the Console → Key Management, delete the leaked Key, and create a new one. If you discover abnormal consumption not initiated by you, please also contact customer support, and we will assist with the investigation.

---

Q: Do you support issuing invoices?

A: For enterprise procurement or compliance needs, please contact <> to discuss.

## Optional Pages

- [Privacy Policy](https://gget.ai/privacy-policy): Privacy policy for the platform.
- [User Agreement](https://gget.ai/user-agreement): Terms and user agreement.
