{
  "openapi": "3.1.0",
  "info": {
    "title": "DataByte AI API",
    "version": "2026-11-13",
    "description": "Endpoint DataByte AI yang bisa dipanggil dengan API key (sk-db-...): teks, gambar, suara, transkripsi, dan video. Harga tidak dimuat di sini; lihat dashboard.",
    "x-description-en": "DataByte AI endpoints reachable with an API key (sk-db-...): text, image, speech, transcription and video. Prices are not part of this document; see the dashboard."
  },
  "servers": [
    {
      "url": "https://ai.databyte.co.id"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Teks"
    },
    {
      "name": "Katalog"
    },
    {
      "name": "Gambar"
    },
    {
      "name": "Suara"
    },
    {
      "name": "Video"
    },
    {
      "name": "Riwayat"
    }
  ],
  "paths": {
    "/v1/chat/completions": {
      "post": {
        "operationId": "createPlanChatCompletion",
        "summary": "Chat (format OpenAI) · Request Based Plan",
        "x-summary-en": "Chat (OpenAI format) · Request Based Plan",
        "description": "Chat Completions format OpenAI untuk model paket. Memotong jatah request paket, bukan saldo. Nama model tanpa awalan provider/.",
        "x-description-en": "OpenAI-format Chat Completions for plan models. Uses the plan’s request quota, not the balance. Model names have no provider/ prefix.",
        "tags": [
          "Teks"
        ],
        "x-group": "text",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "messages"
                ],
                "additionalProperties": true,
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "Nama model paket, misalnya MiniMax-M3.",
                    "x-description-en": "Plan model name, e.g. MiniMax-M3."
                  },
                  "messages": {
                    "type": "array",
                    "description": "Isi percakapan: [{\"role\": \"system\" | \"user\" | \"assistant\", \"content\": \"...\"}].",
                    "x-description-en": "Conversation: [{\"role\": \"system\" | \"user\" | \"assistant\", \"content\": \"...\"}]."
                  },
                  "temperature": {
                    "type": "number",
                    "description": "0 sampai 2.",
                    "x-description-en": "0 to 2.",
                    "minimum": 0,
                    "maximum": 2
                  },
                  "max_tokens": {
                    "type": "integer",
                    "description": "Batas panjang jawaban (token).",
                    "x-description-en": "Maximum output tokens."
                  },
                  "stream": {
                    "type": "boolean",
                    "description": "true untuk menerima jawaban bertahap (Server-Sent Events).",
                    "x-description-en": "true to stream the answer (Server-Sent Events).",
                    "default": false
                  },
                  "enable_mcp": {
                    "type": "boolean",
                    "description": "Aktifkan tool bawaan (web_search, understand_image).",
                    "x-description-en": "Enable built-in tools (web_search, understand_image).",
                    "default": false
                  },
                  "thinking": {
                    "type": "boolean",
                    "description": "Research Mode: model memeriksa jawabannya bertahap.",
                    "x-description-en": "Research Mode: the model checks its work step by step.",
                    "default": false
                  }
                }
              },
              "example": {
                "model": "MiniMax-M3",
                "messages": [
                  {
                    "role": "user",
                    "content": "Halo! Balas dengan satu kalimat saja."
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Jawaban model (JSON, atau SSE kalau stream: true).",
            "x-description-en": "Model answer (JSON, or SSE when stream: true)."
          }
        }
      }
    },
    "/anthropic/v1/messages": {
      "post": {
        "operationId": "createPlanMessage",
        "summary": "Messages (format Anthropic) · Request Based Plan",
        "x-summary-en": "Messages (Anthropic format) · Request Based Plan",
        "description": "Messages format Anthropic untuk model paket. Untuk Anthropic SDK dan Claude Code, base URL-nya https://ai.databyte.co.id/anthropic (tanpa /v1).",
        "x-description-en": "Anthropic-format Messages for plan models. For the Anthropic SDK and Claude Code the base URL is https://ai.databyte.co.id/anthropic (no /v1).",
        "tags": [
          "Teks"
        ],
        "x-group": "text",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "messages",
                  "max_tokens"
                ],
                "additionalProperties": true,
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "Nama model paket, misalnya MiniMax-M3.",
                    "x-description-en": "Plan model name, e.g. MiniMax-M3."
                  },
                  "messages": {
                    "type": "array",
                    "description": "Isi percakapan format Anthropic.",
                    "x-description-en": "Conversation in Anthropic format."
                  },
                  "max_tokens": {
                    "type": "integer",
                    "description": "Batas panjang jawaban (token).",
                    "x-description-en": "Maximum output tokens."
                  },
                  "stream": {
                    "type": "boolean",
                    "description": "true untuk menerima jawaban bertahap.",
                    "x-description-en": "true to stream the answer.",
                    "default": false
                  }
                }
              },
              "example": {
                "model": "MiniMax-M3",
                "messages": [
                  {
                    "role": "user",
                    "content": "Halo! Balas dengan satu kalimat saja."
                  }
                ],
                "max_tokens": 1024
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Jawaban model format Anthropic.",
            "x-description-en": "Model answer in Anthropic format."
          }
        }
      }
    },
    "/gateway/v1/models": {
      "get": {
        "operationId": "listModels",
        "summary": "Daftar model",
        "x-summary-en": "List models",
        "description": "Katalog model AI Gateway yang aktif. Untuk model media, output_modality menunjukkan endpoint yang dipakai dan media_capabilities berisi pilihan yang didukung (voice, resolusi, rasio, durasi). Tidak butuh API key.",
        "x-description-en": "Active AI Gateway models. For media models, output_modality tells which endpoint to call and media_capabilities lists what the model supports (voices, resolutions, aspect ratios, durations). No API key needed.",
        "tags": [
          "Katalog"
        ],
        "x-group": "catalog",
        "security": [],
        "responses": {
          "200": {
            "description": "Daftar model.",
            "x-description-en": "Model list.",
            "content": {
              "application/json": {
                "example": {
                  "object": "list",
                  "data": [
                    {
                      "id": "elevenlabs/eleven-v4-turbo",
                      "object": "model",
                      "name": "Eleven v4 Turbo",
                      "output_modality": "speech",
                      "input_modalities": [
                        "text"
                      ],
                      "media_capabilities": {
                        "supportedVoices": [
                          "george",
                          "sarah",
                          "…"
                        ]
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/gateway/v1/chat/completions": {
      "post": {
        "operationId": "createChatCompletion",
        "summary": "Chat (format OpenAI)",
        "x-summary-en": "Chat (OpenAI format)",
        "description": "Chat Completions format OpenAI untuk model teks AI Gateway. Dipotong dari saldo sesuai jumlah token. Model gambar, suara, dan video ditolak di sini (use_media_endpoint).",
        "x-description-en": "OpenAI-format Chat Completions for AI Gateway text models. Charged per token from the balance. Image, speech and video models are refused here (use_media_endpoint).",
        "tags": [
          "Teks"
        ],
        "x-group": "text",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "messages"
                ],
                "additionalProperties": true,
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "ID model teks dari katalog, format provider/model.",
                    "x-description-en": "Text model ID from the catalog, format provider/model."
                  },
                  "messages": {
                    "type": "array",
                    "description": "Isi percakapan: [{\"role\": \"system\" | \"user\" | \"assistant\", \"content\": \"...\"}].",
                    "x-description-en": "Conversation: [{\"role\": \"system\" | \"user\" | \"assistant\", \"content\": \"...\"}]."
                  },
                  "temperature": {
                    "type": "number",
                    "description": "0 sampai 2.",
                    "x-description-en": "0 to 2.",
                    "minimum": 0,
                    "maximum": 2
                  },
                  "max_tokens": {
                    "type": "integer",
                    "description": "Batas panjang jawaban (token).",
                    "x-description-en": "Maximum output tokens."
                  },
                  "stream": {
                    "type": "boolean",
                    "description": "true untuk menerima jawaban bertahap (Server-Sent Events).",
                    "x-description-en": "true to stream the answer (Server-Sent Events).",
                    "default": false
                  }
                }
              },
              "example": {
                "model": "minimax/minimax-m3",
                "messages": [
                  {
                    "role": "user",
                    "content": "Halo! Balas dengan satu kalimat saja."
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Jawaban model (JSON, atau SSE kalau stream: true).",
            "x-description-en": "Model answer (JSON, or SSE when stream: true)."
          }
        },
        "x-error-codes": [
          "use_media_endpoint"
        ]
      }
    },
    "/gateway/v1/messages": {
      "post": {
        "operationId": "createMessage",
        "summary": "Messages (format Anthropic)",
        "x-summary-en": "Messages (Anthropic format)",
        "description": "Messages format Anthropic untuk model teks AI Gateway. Untuk Anthropic SDK dan Claude Code, base URL-nya https://ai.databyte.co.id/gateway (tanpa /v1).",
        "x-description-en": "Anthropic-format Messages for AI Gateway text models. For the Anthropic SDK and Claude Code the base URL is https://ai.databyte.co.id/gateway (no /v1).",
        "tags": [
          "Teks"
        ],
        "x-group": "text",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "messages",
                  "max_tokens"
                ],
                "additionalProperties": true,
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "ID model teks dari katalog.",
                    "x-description-en": "Text model ID from the catalog."
                  },
                  "messages": {
                    "type": "array",
                    "description": "Isi percakapan format Anthropic.",
                    "x-description-en": "Conversation in Anthropic format."
                  },
                  "max_tokens": {
                    "type": "integer",
                    "description": "Batas panjang jawaban (token).",
                    "x-description-en": "Maximum output tokens."
                  },
                  "stream": {
                    "type": "boolean",
                    "description": "true untuk menerima jawaban bertahap.",
                    "x-description-en": "true to stream the answer.",
                    "default": false
                  }
                }
              },
              "example": {
                "model": "anthropic/claude-sonnet-5.5",
                "messages": [
                  {
                    "role": "user",
                    "content": "Halo! Balas dengan satu kalimat saja."
                  }
                ],
                "max_tokens": 1024
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Jawaban model format Anthropic.",
            "x-description-en": "Model answer in Anthropic format."
          }
        }
      }
    },
    "/gateway/v1/images/generations": {
      "post": {
        "operationId": "createImage",
        "summary": "Buat atau edit gambar",
        "x-summary-en": "Create or edit an image",
        "description": "Membuat gambar dari teks. Dengan input_references, gambar yang dikirim dipakai sebagai acuan (edit). Jawaban datang setelah gambar selesai; ini bisa butuh sampai 3 menit.",
        "x-description-en": "Creates an image from text. With input_references, the images you send are used as references (editing). The answer arrives when the image is ready; that can take up to 3 minutes.",
        "tags": [
          "Gambar"
        ],
        "x-group": "image",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "prompt"
                ],
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "ID model gambar dari katalog.",
                    "x-description-en": "Image model ID from the catalog."
                  },
                  "prompt": {
                    "type": "string",
                    "description": "Deskripsi gambar yang diinginkan.",
                    "x-description-en": "Description of the image you want.",
                    "maxLength": 8000
                  },
                  "n": {
                    "type": "integer",
                    "description": "Jumlah gambar.",
                    "x-description-en": "Number of images.",
                    "minimum": 1,
                    "maximum": 4,
                    "default": 1
                  },
                  "aspect_ratio": {
                    "type": "string",
                    "description": "Rasio lebar:tinggi, misalnya 1:1, 16:9, 9:16.",
                    "x-description-en": "Width:height ratio, e.g. 1:1, 16:9, 9:16.",
                    "x-per-model": true
                  },
                  "resolution": {
                    "type": "string",
                    "description": "Tingkat resolusi (1K, 2K, 4K). Tanpa daftar dari model, maksimal 2K.",
                    "x-description-en": "Resolution tier (1K, 2K, 4K). Without a list from the model, 2K at most.",
                    "x-per-model": true
                  },
                  "size": {
                    "type": "string",
                    "description": "Ukuran piksel LEBARxTINGGI, misalnya 1024x1024. Pakai ini atau resolution.",
                    "x-description-en": "Pixel size WIDTHxHEIGHT, e.g. 1024x1024. Use this or resolution.",
                    "x-per-model": true
                  },
                  "quality": {
                    "type": "string",
                    "description": "Tingkat kualitas, diteruskan ke model apa adanya.",
                    "x-description-en": "Quality level, passed to the model as-is.",
                    "maxLength": 32
                  },
                  "output_format": {
                    "type": "string",
                    "description": "Format file hasil.",
                    "x-description-en": "Output file format.",
                    "enum": [
                      "png",
                      "jpeg",
                      "webp"
                    ]
                  },
                  "response_format": {
                    "type": "string",
                    "description": "url: tautan unduh yang berlaku 1 jam. b64_json: isi gambar langsung di jawaban.",
                    "x-description-en": "url: a download link valid for 1 hour. b64_json: the image itself in the answer.",
                    "enum": [
                      "url",
                      "b64_json"
                    ],
                    "default": "url"
                  },
                  "input_references": {
                    "type": "array",
                    "description": "Gambar acuan untuk edit: [{\"type\": \"image_url\", \"image_url\": {\"url\": \"...\"}}]. URL harus https:// atau data:image/...;base64,... Hanya untuk model yang menerima input gambar.",
                    "x-description-en": "Reference images for editing: [{\"type\": \"image_url\", \"image_url\": {\"url\": \"...\"}}]. The URL must be https:// or data:image/...;base64,... Only for models that accept image input.",
                    "maxItems": 4
                  }
                }
              },
              "example": {
                "model": "google/gemini-nano-banana-2.1",
                "prompt": "Kucing oranye memakai kacamata bulat, ilustrasi datar, latar biru muda",
                "n": 1,
                "aspect_ratio": "1:1"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Gambar selesai dan sudah ditagih.",
            "x-description-en": "The image is ready and has been billed.",
            "headers": {
              "x-databyte-cost-usd": {
                "description": "Biaya yang dipotong dari saldo untuk request ini (USD).",
                "x-description-en": "Amount charged to the balance for this request (USD).",
                "schema": {
                  "type": "string"
                }
              },
              "x-databyte-generation-id": {
                "description": "ID hasil. Pakai untuk GET /generations/{id}.",
                "x-description-en": "Generation ID. Use it with GET /generations/{id}.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "id": "img_1f0c9c1e-7a52-4d0e-9a55-2b7d7f0f3c11",
                  "created": 1715000000,
                  "data": [
                    {
                      "url": "https://…/0.png?…"
                    }
                  ],
                  "usage": {
                    "images": 1,
                    "cost_usd": 0.01,
                    "cost_idr": 170
                  }
                }
              }
            }
          }
        },
        "x-error-codes": [
          "missing_prompt",
          "prompt_too_long",
          "invalid_n",
          "invalid_input_references",
          "invalid_parameter",
          "unsupported_parameter",
          "media_rate_limited",
          "rate_limit_exceeded",
          "upstream_invalid_request",
          "upstream_no_output",
          "upstream_timeout",
          "upstream_error",
          "generation_failed"
        ]
      }
    },
    "/gateway/v1/audio/speech": {
      "post": {
        "operationId": "createSpeech",
        "summary": "Teks menjadi suara (TTS)",
        "x-summary-en": "Text to speech (TTS)",
        "description": "Mengubah teks menjadi suara. Jawaban sukses adalah file audio itu sendiri (bukan JSON). Biaya dihitung setelah audio dikirim; baca lewat GET /generations/{id} memakai ID di header. Endpoint yang sama juga ada di /v1/audio/speech, dengan tagihan yang sama.",
        "x-description-en": "Turns text into speech. A successful answer is the audio file itself (not JSON). The cost is computed after the audio is sent; read it with GET /generations/{id} using the ID from the header. The same endpoint also exists at /v1/audio/speech, billed the same way.",
        "tags": [
          "Suara"
        ],
        "x-group": "speech",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "input"
                ],
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "ID model suara dari katalog.",
                    "x-description-en": "Speech model ID from the catalog."
                  },
                  "input": {
                    "type": "string",
                    "description": "Teks yang dibacakan. Ekspresi diatur dengan tag di dalam teks, misalnya [whispers] atau [excited] (bergantung model).",
                    "x-description-en": "Text to read. Expression is set with tags inside the text, e.g. [whispers] or [excited] (model dependent).",
                    "maxLength": 10000
                  },
                  "voice": {
                    "type": "string",
                    "description": "Nama voice. Kalau kosong, dipakai voice pertama milik model.",
                    "x-description-en": "Voice name. When omitted, the model’s first voice is used.",
                    "x-per-model": true
                  },
                  "response_format": {
                    "type": "string",
                    "description": "Format audio. pcm = audio mentah tanpa header.",
                    "x-description-en": "Audio format. pcm = raw audio without a header.",
                    "enum": [
                      "mp3",
                      "pcm"
                    ],
                    "default": "mp3"
                  },
                  "speed": {
                    "type": "number",
                    "description": "Kecepatan bicara. Tidak semua model menerimanya; model yang tidak mendukung menjawab 400.",
                    "x-description-en": "Speaking speed. Not every model accepts it; a model that does not answers 400.",
                    "minimum": 0.25,
                    "maximum": 4,
                    "x-per-model": true
                  },
                  "instructions": {
                    "type": "string",
                    "description": "Arahan gaya bicara. Tidak semua model memakainya.",
                    "x-description-en": "Speaking-style instructions. Not every model uses them.",
                    "maxLength": 1000,
                    "x-per-model": true
                  }
                }
              },
              "example": {
                "model": "elevenlabs/eleven-v4-turbo",
                "voice": "sarah",
                "input": "Halo! Ini suara yang dibuat lewat DataByte AI Gateway.",
                "response_format": "mp3"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "File audio (audio/mpeg untuk mp3).",
            "x-description-en": "The audio file (audio/mpeg for mp3).",
            "headers": {
              "x-databyte-generation-id": {
                "description": "ID hasil. Pakai untuk GET /generations/{id}.",
                "x-description-en": "Generation ID. Use it with GET /generations/{id}.",
                "schema": {
                  "type": "string"
                }
              },
              "x-databyte-hold-usd": {
                "description": "Saldo yang ditahan sementara untuk request ini (USD). Sisanya dilepas setelah biaya akhir ditagih.",
                "x-description-en": "Balance held for this request (USD). The rest is released once the final cost is charged.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "audio/mpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          }
        },
        "x-error-codes": [
          "missing_input",
          "input_too_long",
          "invalid_parameter",
          "unsupported_parameter",
          "media_rate_limited",
          "rate_limit_exceeded",
          "upstream_invalid_request",
          "upstream_output_too_large",
          "upstream_timeout",
          "upstream_error"
        ]
      }
    },
    "/gateway/v1/audio/transcriptions": {
      "post": {
        "operationId": "createTranscription",
        "summary": "Suara menjadi teks (STT)",
        "x-summary-en": "Speech to text (STT)",
        "description": "Menulis ulang isi rekaman menjadi teks. Kirim file lewat multipart/form-data (seperti OpenAI), atau JSON berisi input_audio (base64 atau URL). Rekaman panjang bisa butuh lebih dari 5 menit. Endpoint yang sama juga ada di /v1/audio/transcriptions, dengan tagihan yang sama.",
        "x-description-en": "Transcribes a recording. Send the file as multipart/form-data (like OpenAI), or JSON with input_audio (base64 or URL). Long recordings can take more than 5 minutes. The same endpoint also exists at /v1/audio/transcriptions, billed the same way.",
        "tags": [
          "Suara"
        ],
        "x-group": "transcription",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file",
                  "model"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "description": "File audio, maksimal 25 MB: mp3, mp4, mpeg, mpga, m4a, wav, webm, ogg, flac.",
                    "x-description-en": "Audio file, 25 MB at most: mp3, mp4, mpeg, mpga, m4a, wav, webm, ogg, flac.",
                    "format": "binary"
                  },
                  "model": {
                    "type": "string",
                    "description": "ID model transkripsi dari katalog.",
                    "x-description-en": "Transcription model ID from the catalog."
                  },
                  "language": {
                    "type": "string",
                    "description": "Kode bahasa rekaman, misalnya id atau en. Membantu akurasi.",
                    "x-description-en": "Language code of the recording, e.g. id or en. Helps accuracy."
                  },
                  "response_format": {
                    "type": "string",
                    "description": "Diteruskan ke model. Bentuk jawaban DataByte tetap { id, text, usage }.",
                    "x-description-en": "Passed to the model. The DataByte answer stays { id, text, usage }.",
                    "enum": [
                      "json",
                      "verbose_json"
                    ],
                    "default": "json"
                  }
                }
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "input_audio"
                ],
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "ID model transkripsi dari katalog.",
                    "x-description-en": "Transcription model ID from the catalog."
                  },
                  "input_audio": {
                    "type": "object",
                    "description": "{\"data\": \"<base64>\", \"format\": \"mp3\"} atau {\"url\": \"https://...\", \"format\": \"mp3\"}. Untuk file besar pakai multipart.",
                    "x-description-en": "{\"data\": \"<base64>\", \"format\": \"mp3\"} or {\"url\": \"https://...\", \"format\": \"mp3\"}. Use multipart for large files."
                  },
                  "language": {
                    "type": "string",
                    "description": "Kode bahasa rekaman, misalnya id atau en.",
                    "x-description-en": "Language code of the recording, e.g. id or en."
                  },
                  "response_format": {
                    "type": "string",
                    "description": "Diteruskan ke model. Bentuk jawaban DataByte tetap { id, text, usage }.",
                    "x-description-en": "Passed to the model. The DataByte answer stays { id, text, usage }.",
                    "enum": [
                      "json",
                      "verbose_json"
                    ],
                    "default": "json"
                  }
                }
              },
              "example": {
                "model": "ID_MODEL_TRANSKRIPSI",
                "input_audio": {
                  "url": "https://example.com/rekaman.mp3",
                  "format": "mp3"
                },
                "language": "id"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Teks hasil transkripsi, sudah ditagih. usage.seconds hanya ada kalau model melaporkan durasinya.",
            "x-description-en": "The transcript, already billed. usage.seconds is present only when the model reports the duration.",
            "headers": {
              "x-databyte-cost-usd": {
                "description": "Biaya yang dipotong dari saldo untuk request ini (USD).",
                "x-description-en": "Amount charged to the balance for this request (USD).",
                "schema": {
                  "type": "string"
                }
              },
              "x-databyte-generation-id": {
                "description": "ID hasil. Pakai untuk GET /generations/{id}.",
                "x-description-en": "Generation ID. Use it with GET /generations/{id}.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "id": "stt_6a1d3d0a-2f6b-4a57-8d1e-0c1a9a4c7b22",
                  "text": "Selamat pagi, rapat hari ini dimulai pukul sembilan.",
                  "usage": {
                    "seconds": 42.5,
                    "cost_usd": 0.01,
                    "cost_idr": 170
                  }
                }
              }
            }
          }
        },
        "x-error-codes": [
          "invalid_multipart",
          "missing_file",
          "missing_audio",
          "invalid_audio",
          "invalid_audio_url",
          "unsupported_format",
          "file_too_large",
          "audio_too_long",
          "invalid_parameter",
          "unsupported_parameter",
          "media_rate_limited",
          "rate_limit_exceeded",
          "upstream_invalid_request",
          "upstream_timeout",
          "upstream_error"
        ]
      }
    },
    "/gateway/v1/videos": {
      "post": {
        "operationId": "createVideo",
        "summary": "Buat video (asinkron)",
        "x-summary-en": "Create a video (asynchronous)",
        "description": "Mengirim pekerjaan video. Jawabannya 202 berisi ID; videonya dibuat di belakang layar selama beberapa menit. Pantau lewat GET /videos/{id}. Saldo ditahan saat pekerjaan dikirim dan baru ditagih saat video selesai; pekerjaan yang gagal tidak ditagih. Video hanya untuk akun yang sudah pernah top-up, dan saldo bonus tidak bisa dipakai.",
        "x-description-en": "Submits a video job. The answer is 202 with an ID; the video is made in the background over a few minutes. Follow it with GET /videos/{id}. The balance is held when the job is submitted and only charged when the video completes; a failed job is not charged. Video is only for accounts that have topped up at least once, and bonus balance cannot pay for it.",
        "tags": [
          "Video"
        ],
        "x-group": "video",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model"
                ],
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "ID model video dari katalog.",
                    "x-description-en": "Video model ID from the catalog."
                  },
                  "prompt": {
                    "type": "string",
                    "description": "Deskripsi video. Wajib, kecuali video dibuat dari frame_images.",
                    "x-description-en": "Description of the video. Required unless the video is made from frame_images.",
                    "maxLength": 4000
                  },
                  "duration": {
                    "type": "number",
                    "description": "Durasi dalam detik. Kalau kosong: durasi terpendek milik model, atau 5 detik. Tanpa daftar dari model, maksimal 60 detik.",
                    "x-description-en": "Duration in seconds. When omitted: the model’s shortest duration, or 5 seconds. Without a list from the model, 60 seconds at most.",
                    "x-per-model": true
                  },
                  "resolution": {
                    "type": "string",
                    "description": "Resolusi, misalnya 720p atau 1080p.",
                    "x-description-en": "Resolution, e.g. 720p or 1080p.",
                    "x-per-model": true
                  },
                  "aspect_ratio": {
                    "type": "string",
                    "description": "Rasio lebar:tinggi, misalnya 16:9 atau 9:16.",
                    "x-description-en": "Width:height ratio, e.g. 16:9 or 9:16.",
                    "x-per-model": true
                  },
                  "size": {
                    "type": "string",
                    "description": "Ukuran piksel LEBARxTINGGI, misalnya 1280x720.",
                    "x-description-en": "Pixel size WIDTHxHEIGHT, e.g. 1280x720.",
                    "x-per-model": true
                  },
                  "generate_audio": {
                    "type": "boolean",
                    "description": "true untuk membuat video dengan suara, kalau model mendukung.",
                    "x-description-en": "true to create the video with sound, when the model supports it.",
                    "x-per-model": true
                  },
                  "seed": {
                    "type": "integer",
                    "description": "Angka acuan agar hasil lebih mudah diulang.",
                    "x-description-en": "Seed number, to make results easier to reproduce."
                  },
                  "frame_images": {
                    "type": "array",
                    "description": "Gambar awal/akhir video: [{\"type\": \"image_url\", \"frame_type\": \"first_frame\" | \"last_frame\", \"image_url\": {\"url\": \"...\"}}].",
                    "x-description-en": "First/last frame of the video: [{\"type\": \"image_url\", \"frame_type\": \"first_frame\" | \"last_frame\", \"image_url\": {\"url\": \"...\"}}].",
                    "maxItems": 2,
                    "x-per-model": true
                  },
                  "input_references": {
                    "type": "array",
                    "description": "Bahan acuan: [{\"type\": \"image_url\" | \"audio_url\" | \"video_url\", \"<type>\": {\"url\": \"...\"}}].",
                    "x-description-en": "Reference material: [{\"type\": \"image_url\" | \"audio_url\" | \"video_url\", \"<type>\": {\"url\": \"...\"}}].",
                    "maxItems": 10
                  }
                }
              },
              "example": {
                "model": "ID_MODEL_VIDEO",
                "prompt": "Drone terbang pelan di atas sawah terasering saat matahari terbit",
                "duration": 5,
                "aspect_ratio": "16:9"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Pekerjaan diterima. Belum ada video dan belum ada tagihan.",
            "x-description-en": "Job accepted. No video and no charge yet.",
            "headers": {
              "x-databyte-generation-id": {
                "description": "ID hasil. Pakai untuk GET /generations/{id}.",
                "x-description-en": "Generation ID. Use it with GET /generations/{id}.",
                "schema": {
                  "type": "string"
                }
              },
              "x-databyte-hold-usd": {
                "description": "Saldo yang ditahan sementara untuk request ini (USD). Sisanya dilepas setelah biaya akhir ditagih.",
                "x-description-en": "Balance held for this request (USD). The rest is released once the final cost is charged.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "id": "vid_3b9f0a52-8c1d-4c0e-b0a7-5d2e9f6a1c33",
                  "object": "video.generation",
                  "status": "pending",
                  "model": "ID_MODEL_VIDEO",
                  "created": 1715000000,
                  "hold_usd": 0.5,
                  "polling_url": "/gateway/v1/videos/vid_3b9f0a52-8c1d-4c0e-b0a7-5d2e9f6a1c33"
                }
              }
            }
          }
        },
        "x-error-codes": [
          "missing_required_parameter",
          "invalid_parameter",
          "unsupported_parameter",
          "video_requires_topup",
          "media_rate_limited",
          "rate_limit_exceeded",
          "upstream_rejected",
          "upstream_error"
        ]
      }
    },
    "/gateway/v1/videos/{id}": {
      "get": {
        "operationId": "getVideo",
        "summary": "Status video",
        "x-summary-en": "Video status",
        "description": "Status dan hasil satu pekerjaan video milik Anda. Panggil tiap 10-15 detik sampai status final. Saat completed, url berisi tautan unduh yang berlaku 1 jam.",
        "x-description-en": "Status and result of one of your video jobs. Call it every 10-15 seconds until the status is final. Once completed, url holds a download link valid for 1 hour.",
        "tags": [
          "Video"
        ],
        "x-group": "video",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID video (vid_...).",
            "x-description-en": "Video ID (vid_...).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Objek generation.",
            "x-description-en": "A generation object.",
            "headers": {
              "x-databyte-cost-usd": {
                "description": "Biaya yang dipotong dari saldo untuk request ini (USD).",
                "x-description-en": "Amount charged to the balance for this request (USD).",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "ID hasil. Awalan menunjukkan jenisnya: img_, tts_, stt_, vid_.",
                      "x-description-en": "Generation ID. The prefix tells the kind: img_, tts_, stt_, vid_."
                    },
                    "object": {
                      "type": "string",
                      "description": "Selalu \"media.generation\".",
                      "x-description-en": "Always \"media.generation\"."
                    },
                    "status": {
                      "type": "string",
                      "description": "Status saat ini. completed, failed, cancelled, dan expired sudah final.",
                      "x-description-en": "Current status. completed, failed, cancelled and expired are final.",
                      "enum": [
                        "pending",
                        "processing",
                        "completed",
                        "failed",
                        "cancelled",
                        "expired"
                      ]
                    },
                    "model": {
                      "type": "string",
                      "description": "ID model yang dipakai.",
                      "x-description-en": "Model ID used."
                    },
                    "modality": {
                      "type": "string",
                      "description": "Jenis hasil.",
                      "x-description-en": "Kind of output.",
                      "enum": [
                        "image",
                        "speech",
                        "transcription",
                        "video"
                      ]
                    },
                    "created": {
                      "type": "integer",
                      "description": "Waktu dibuat (detik Unix).",
                      "x-description-en": "Creation time (Unix seconds)."
                    },
                    "url": {
                      "type": "string",
                      "description": "Tautan unduh file pertama, berlaku 1 jam. null kalau belum selesai atau tidak ada file.",
                      "x-description-en": "Download link of the first file, valid for 1 hour. null when not completed or there is no file."
                    },
                    "urls": {
                      "type": "array",
                      "description": "Tautan unduh semua file hasil.",
                      "x-description-en": "Download links of every output file.",
                      "items": {
                        "type": "string"
                      }
                    },
                    "prompt": {
                      "type": "string",
                      "description": "Prompt atau potongan awal teks yang dikirim.",
                      "x-description-en": "The prompt, or the start of the text that was sent."
                    },
                    "unit_type": {
                      "type": "string",
                      "description": "Satuan tagihan.",
                      "x-description-en": "Billing unit.",
                      "enum": [
                        "image",
                        "second",
                        "char",
                        "minute"
                      ]
                    },
                    "units": {
                      "type": "number",
                      "description": "Jumlah satuan yang ditagih.",
                      "x-description-en": "Number of units billed."
                    },
                    "hold_usd": {
                      "type": "number",
                      "description": "Saldo yang masih ditahan (USD) selama belum final; null setelah final.",
                      "x-description-en": "Balance still held (USD) while not final; null once final."
                    },
                    "cost_usd": {
                      "type": "number",
                      "description": "Biaya akhir (USD); null kalau belum ditagih.",
                      "x-description-en": "Final cost (USD); null when not billed yet."
                    },
                    "cost_idr": {
                      "type": "integer",
                      "description": "Biaya akhir dalam Rupiah.",
                      "x-description-en": "Final cost in Rupiah."
                    },
                    "is_estimated": {
                      "type": "boolean",
                      "description": "true kalau biaya memakai perkiraan karena biaya pasti belum tersedia.",
                      "x-description-en": "true when the cost is an estimate because the exact cost was not available."
                    },
                    "error": {
                      "type": "object",
                      "description": "Terisi kalau gagal: { message, code }. null kalau berhasil.",
                      "x-description-en": "Set on failure: { message, code }. null on success."
                    },
                    "completed_at": {
                      "type": "integer",
                      "description": "Waktu selesai (detik Unix).",
                      "x-description-en": "Completion time (Unix seconds)."
                    },
                    "expires_at": {
                      "type": "integer",
                      "description": "Waktu file dihapus dari penyimpanan (detik Unix). Unduh sebelum waktu ini.",
                      "x-description-en": "When the files are deleted from storage (Unix seconds). Download before then."
                    }
                  }
                }
              }
            }
          }
        },
        "x-error-codes": [
          "generation_not_found"
        ]
      }
    },
    "/gateway/v1/videos/{id}/content": {
      "get": {
        "operationId": "getVideoContent",
        "summary": "Unduh video",
        "x-summary-en": "Download a video",
        "description": "Mengalihkan (302) ke tautan unduh file video. Klien yang ikut mengirim header Authorization ke alamat tujuan akan ditolak di sana; untuk klien seperti itu ambil url dari GET /videos/{id}.",
        "x-description-en": "Redirects (302) to the download link of the video file. A client that forwards the Authorization header to the redirect target is refused there; for such clients take url from GET /videos/{id}.",
        "tags": [
          "Video"
        ],
        "x-group": "video",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID video (vid_...).",
            "x-description-en": "Video ID (vid_...).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "index",
            "in": "query",
            "description": "Nomor file kalau hasilnya lebih dari satu.",
            "x-description-en": "File number when there is more than one output.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Dialihkan ke tautan unduh (berlaku 1 jam).",
            "x-description-en": "Redirect to the download link (valid for 1 hour)."
          }
        },
        "x-error-codes": [
          "generation_not_found",
          "generation_not_completed",
          "content_expired",
          "content_unavailable",
          "content_not_found",
          "invalid_parameter"
        ]
      }
    },
    "/gateway/v1/generations": {
      "get": {
        "operationId": "listGenerations",
        "summary": "Riwayat hasil media",
        "x-summary-en": "Media generation history",
        "description": "Daftar hasil gambar, suara, transkripsi, dan video milik Anda, terbaru dulu. Berisi status, biaya, dan tautan unduh.",
        "x-description-en": "Your image, speech, transcription and video generations, newest first. Includes status, cost and download links.",
        "tags": [
          "Riwayat"
        ],
        "x-group": "history",
        "parameters": [
          {
            "name": "modality",
            "in": "query",
            "description": "Saring per jenis.",
            "x-description-en": "Filter by kind.",
            "schema": {
              "type": "string",
              "enum": [
                "image",
                "video",
                "speech",
                "transcription"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Jumlah per halaman.",
            "x-description-en": "Items per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Isi dengan next_cursor dari halaman sebelumnya.",
            "x-description-en": "The next_cursor of the previous page.",
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Satu halaman riwayat.",
            "x-description-en": "One page of history.",
            "content": {
              "application/json": {
                "example": {
                  "object": "list",
                  "data": [
                    {
                      "id": "tts_9d2c7e44-1b0a-4f3e-8a6d-7c5b4a3e2f10",
                      "object": "media.generation",
                      "status": "completed",
                      "model": "elevenlabs/eleven-v4-turbo",
                      "modality": "speech",
                      "created": 1715000000,
                      "url": "https://…/0.mp3?…",
                      "urls": [
                        "https://…/0.mp3?…"
                      ],
                      "prompt": "Halo! Ini suara yang dibuat lewat DataByte AI Gateway.",
                      "unit_type": "char",
                      "units": 54,
                      "hold_usd": null,
                      "cost_usd": 0.01,
                      "cost_idr": 170,
                      "is_estimated": false,
                      "error": null,
                      "completed_at": 1715000004,
                      "expires_at": 1715604800
                    }
                  ],
                  "next_cursor": null,
                  "has_more": false
                }
              }
            }
          }
        },
        "x-error-codes": [
          "invalid_parameter"
        ]
      }
    },
    "/gateway/v1/generations/{id}": {
      "get": {
        "operationId": "getGeneration",
        "summary": "Detail satu hasil",
        "x-summary-en": "One generation",
        "description": "Detail satu hasil milik Anda, jenis apa pun. Dipakai untuk membaca biaya suara (TTS) dan untuk mengambil ulang tautan unduh yang sudah kedaluwarsa.",
        "x-description-en": "One of your generations, any kind. Used to read the cost of speech (TTS) and to get a fresh download link when the old one expired.",
        "tags": [
          "Riwayat"
        ],
        "x-group": "history",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID hasil (img_, tts_, stt_, vid_).",
            "x-description-en": "Generation ID (img_, tts_, stt_, vid_).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Objek generation.",
            "x-description-en": "A generation object.",
            "headers": {
              "x-databyte-cost-usd": {
                "description": "Biaya yang dipotong dari saldo untuk request ini (USD).",
                "x-description-en": "Amount charged to the balance for this request (USD).",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "ID hasil. Awalan menunjukkan jenisnya: img_, tts_, stt_, vid_.",
                      "x-description-en": "Generation ID. The prefix tells the kind: img_, tts_, stt_, vid_."
                    },
                    "object": {
                      "type": "string",
                      "description": "Selalu \"media.generation\".",
                      "x-description-en": "Always \"media.generation\"."
                    },
                    "status": {
                      "type": "string",
                      "description": "Status saat ini. completed, failed, cancelled, dan expired sudah final.",
                      "x-description-en": "Current status. completed, failed, cancelled and expired are final.",
                      "enum": [
                        "pending",
                        "processing",
                        "completed",
                        "failed",
                        "cancelled",
                        "expired"
                      ]
                    },
                    "model": {
                      "type": "string",
                      "description": "ID model yang dipakai.",
                      "x-description-en": "Model ID used."
                    },
                    "modality": {
                      "type": "string",
                      "description": "Jenis hasil.",
                      "x-description-en": "Kind of output.",
                      "enum": [
                        "image",
                        "speech",
                        "transcription",
                        "video"
                      ]
                    },
                    "created": {
                      "type": "integer",
                      "description": "Waktu dibuat (detik Unix).",
                      "x-description-en": "Creation time (Unix seconds)."
                    },
                    "url": {
                      "type": "string",
                      "description": "Tautan unduh file pertama, berlaku 1 jam. null kalau belum selesai atau tidak ada file.",
                      "x-description-en": "Download link of the first file, valid for 1 hour. null when not completed or there is no file."
                    },
                    "urls": {
                      "type": "array",
                      "description": "Tautan unduh semua file hasil.",
                      "x-description-en": "Download links of every output file.",
                      "items": {
                        "type": "string"
                      }
                    },
                    "prompt": {
                      "type": "string",
                      "description": "Prompt atau potongan awal teks yang dikirim.",
                      "x-description-en": "The prompt, or the start of the text that was sent."
                    },
                    "unit_type": {
                      "type": "string",
                      "description": "Satuan tagihan.",
                      "x-description-en": "Billing unit.",
                      "enum": [
                        "image",
                        "second",
                        "char",
                        "minute"
                      ]
                    },
                    "units": {
                      "type": "number",
                      "description": "Jumlah satuan yang ditagih.",
                      "x-description-en": "Number of units billed."
                    },
                    "hold_usd": {
                      "type": "number",
                      "description": "Saldo yang masih ditahan (USD) selama belum final; null setelah final.",
                      "x-description-en": "Balance still held (USD) while not final; null once final."
                    },
                    "cost_usd": {
                      "type": "number",
                      "description": "Biaya akhir (USD); null kalau belum ditagih.",
                      "x-description-en": "Final cost (USD); null when not billed yet."
                    },
                    "cost_idr": {
                      "type": "integer",
                      "description": "Biaya akhir dalam Rupiah.",
                      "x-description-en": "Final cost in Rupiah."
                    },
                    "is_estimated": {
                      "type": "boolean",
                      "description": "true kalau biaya memakai perkiraan karena biaya pasti belum tersedia.",
                      "x-description-en": "true when the cost is an estimate because the exact cost was not available."
                    },
                    "error": {
                      "type": "object",
                      "description": "Terisi kalau gagal: { message, code }. null kalau berhasil.",
                      "x-description-en": "Set on failure: { message, code }. null on success."
                    },
                    "completed_at": {
                      "type": "integer",
                      "description": "Waktu selesai (detik Unix).",
                      "x-description-en": "Completion time (Unix seconds)."
                    },
                    "expires_at": {
                      "type": "integer",
                      "description": "Waktu file dihapus dari penyimpanan (detik Unix). Unduh sebelum waktu ini.",
                      "x-description-en": "When the files are deleted from storage (Unix seconds). Download before then."
                    }
                  }
                },
                "example": {
                  "id": "tts_9d2c7e44-1b0a-4f3e-8a6d-7c5b4a3e2f10",
                  "object": "media.generation",
                  "status": "completed",
                  "model": "elevenlabs/eleven-v4-turbo",
                  "modality": "speech",
                  "created": 1715000000,
                  "url": "https://…/0.mp3?…",
                  "urls": [
                    "https://…/0.mp3?…"
                  ],
                  "prompt": "Halo! Ini suara yang dibuat lewat DataByte AI Gateway.",
                  "unit_type": "char",
                  "units": 54,
                  "hold_usd": null,
                  "cost_usd": 0.01,
                  "cost_idr": 170,
                  "is_estimated": false,
                  "error": null,
                  "completed_at": 1715000004,
                  "expires_at": 1715604800
                }
              }
            }
          }
        },
        "x-error-codes": [
          "generation_not_found"
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "API key DataByte (sk-db-...) di header Authorization: Bearer. Endpoint format Anthropic juga menerima header x-api-key."
      }
    },
    "schemas": {
      "Generation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "ID hasil. Awalan menunjukkan jenisnya: img_, tts_, stt_, vid_.",
            "x-description-en": "Generation ID. The prefix tells the kind: img_, tts_, stt_, vid_."
          },
          "object": {
            "type": "string",
            "description": "Selalu \"media.generation\".",
            "x-description-en": "Always \"media.generation\"."
          },
          "status": {
            "type": "string",
            "description": "Status saat ini. completed, failed, cancelled, dan expired sudah final.",
            "x-description-en": "Current status. completed, failed, cancelled and expired are final.",
            "enum": [
              "pending",
              "processing",
              "completed",
              "failed",
              "cancelled",
              "expired"
            ]
          },
          "model": {
            "type": "string",
            "description": "ID model yang dipakai.",
            "x-description-en": "Model ID used."
          },
          "modality": {
            "type": "string",
            "description": "Jenis hasil.",
            "x-description-en": "Kind of output.",
            "enum": [
              "image",
              "speech",
              "transcription",
              "video"
            ]
          },
          "created": {
            "type": "integer",
            "description": "Waktu dibuat (detik Unix).",
            "x-description-en": "Creation time (Unix seconds)."
          },
          "url": {
            "type": "string",
            "description": "Tautan unduh file pertama, berlaku 1 jam. null kalau belum selesai atau tidak ada file.",
            "x-description-en": "Download link of the first file, valid for 1 hour. null when not completed or there is no file."
          },
          "urls": {
            "type": "array",
            "description": "Tautan unduh semua file hasil.",
            "x-description-en": "Download links of every output file.",
            "items": {
              "type": "string"
            }
          },
          "prompt": {
            "type": "string",
            "description": "Prompt atau potongan awal teks yang dikirim.",
            "x-description-en": "The prompt, or the start of the text that was sent."
          },
          "unit_type": {
            "type": "string",
            "description": "Satuan tagihan.",
            "x-description-en": "Billing unit.",
            "enum": [
              "image",
              "second",
              "char",
              "minute"
            ]
          },
          "units": {
            "type": "number",
            "description": "Jumlah satuan yang ditagih.",
            "x-description-en": "Number of units billed."
          },
          "hold_usd": {
            "type": "number",
            "description": "Saldo yang masih ditahan (USD) selama belum final; null setelah final.",
            "x-description-en": "Balance still held (USD) while not final; null once final."
          },
          "cost_usd": {
            "type": "number",
            "description": "Biaya akhir (USD); null kalau belum ditagih.",
            "x-description-en": "Final cost (USD); null when not billed yet."
          },
          "cost_idr": {
            "type": "integer",
            "description": "Biaya akhir dalam Rupiah.",
            "x-description-en": "Final cost in Rupiah."
          },
          "is_estimated": {
            "type": "boolean",
            "description": "true kalau biaya memakai perkiraan karena biaya pasti belum tersedia.",
            "x-description-en": "true when the cost is an estimate because the exact cost was not available."
          },
          "error": {
            "type": "object",
            "description": "Terisi kalau gagal: { message, code }. null kalau berhasil.",
            "x-description-en": "Set on failure: { message, code }. null on success."
          },
          "completed_at": {
            "type": "integer",
            "description": "Waktu selesai (detik Unix).",
            "x-description-en": "Completion time (Unix seconds)."
          },
          "expires_at": {
            "type": "integer",
            "description": "Waktu file dihapus dari penyimpanan (detik Unix). Unduh sebelum waktu ini.",
            "x-description-en": "When the files are deleted from storage (Unix seconds). Download before then."
          }
        }
      }
    }
  },
  "x-error-codes": [
    {
      "code": "missing_api_key",
      "status": 401,
      "common": true,
      "description": "Header Authorization tidak ada.",
      "x-description-en": "No Authorization header."
    },
    {
      "code": "invalid_api_key",
      "status": 401,
      "common": true,
      "description": "API key salah atau sudah dihapus.",
      "x-description-en": "The API key is wrong or was deleted."
    },
    {
      "code": "api_key_expired",
      "status": 401,
      "common": true,
      "description": "API key sudah kedaluwarsa.",
      "x-description-en": "The API key has expired."
    },
    {
      "code": "invalid_token",
      "status": 401,
      "common": true,
      "description": "Token sesi dashboard tidak valid. Pakai API key.",
      "x-description-en": "Invalid dashboard session token. Use an API key."
    },
    {
      "code": "unauthenticated",
      "status": 401,
      "common": true,
      "description": "Kredensial tidak dikenali.",
      "x-description-en": "Credentials not recognised."
    },
    {
      "code": "insufficient_balance",
      "status": 402,
      "common": true,
      "description": "Saldo tidak cukup untuk request ini. Top up dulu.",
      "x-description-en": "The balance does not cover this request. Top up first."
    },
    {
      "code": "key_spend_limit_exceeded",
      "status": 402,
      "common": true,
      "description": "Batas belanja API key ini sudah tercapai.",
      "x-description-en": "This API key reached its spend limit."
    },
    {
      "code": "forbidden_product_scope",
      "status": 403,
      "common": true,
      "description": "API key ini tidak diizinkan memakai AI Gateway.",
      "x-description-en": "This API key is not allowed to use the AI Gateway."
    },
    {
      "code": "user_inactive",
      "status": 403,
      "common": true,
      "description": "Akun tidak aktif.",
      "x-description-en": "The account is inactive."
    },
    {
      "code": "model_not_allowed",
      "status": 403,
      "common": true,
      "description": "API key ini dibatasi ke model lain.",
      "x-description-en": "This API key is restricted to other models."
    },
    {
      "code": "model_disabled_by_user",
      "status": 403,
      "common": true,
      "description": "Model dimatikan di Dashboard > Model Access.",
      "x-description-en": "The model is switched off in Dashboard > Model Access."
    },
    {
      "code": "model_not_allowed_for_key",
      "status": 403,
      "common": true,
      "description": "API key ini dibatasi ke model lain.",
      "x-description-en": "This API key is restricted to other models."
    },
    {
      "code": "api_key_request_limit_exceeded",
      "status": 429,
      "common": true,
      "description": "Jatah request API key ini habis untuk periode berjalan.",
      "x-description-en": "This API key used up its request quota for the current period."
    },
    {
      "code": "api_key_token_limit_exceeded",
      "status": 429,
      "common": true,
      "description": "Jatah token API key ini habis untuk periode berjalan.",
      "x-description-en": "This API key used up its token quota for the current period."
    },
    {
      "code": "api_key_rpm_exceeded",
      "status": 429,
      "common": true,
      "retry": true,
      "description": "Batas request per menit API key tercapai. Tunggu sesuai header Retry-After.",
      "x-description-en": "The API key’s requests-per-minute limit was reached. Wait as told by the Retry-After header."
    },
    {
      "code": "gateway_maintenance",
      "status": 503,
      "common": true,
      "retry": true,
      "description": "AI Gateway sedang dalam pemeliharaan.",
      "x-description-en": "The AI Gateway is under maintenance."
    },
    {
      "code": "internal_error",
      "status": 500,
      "common": true,
      "description": "Kesalahan di sisi DataByte. Untuk media, cek GET /generations sebelum mengulang.",
      "x-description-en": "An error on the DataByte side. For media, check GET /generations before retrying."
    },
    {
      "code": "model_required",
      "status": 400,
      "description": "Parameter model tidak diisi.",
      "x-description-en": "The model parameter is missing."
    },
    {
      "code": "model_not_active",
      "status": 400,
      "description": "Model tidak ditemukan atau sedang tidak aktif. Cek katalog.",
      "x-description-en": "Model not found or not active. Check the catalog."
    },
    {
      "code": "modality_not_enabled",
      "status": 400,
      "description": "Jenis model ini (misalnya video) belum dibuka di AI Gateway.",
      "x-description-en": "This kind of model (e.g. video) is not open on the AI Gateway yet."
    },
    {
      "code": "model_modality_mismatch",
      "status": 400,
      "description": "Model dipanggil di endpoint yang salah. Pesan error menyebut endpoint yang benar.",
      "x-description-en": "The model was called on the wrong endpoint. The message names the right one."
    },
    {
      "code": "use_media_endpoint",
      "status": 400,
      "description": "Model gambar, suara, atau video dipanggil lewat chat. Pakai endpoint medianya.",
      "x-description-en": "An image, speech or video model was called through chat. Use its media endpoint."
    },
    {
      "code": "model_pricing_unavailable",
      "status": 400,
      "description": "Model belum siap dipakai. Hubungi support.",
      "x-description-en": "The model is not ready for use. Contact support."
    },
    {
      "code": "provider_not_supported",
      "status": 400,
      "description": "Model belum mendukung endpoint ini.",
      "x-description-en": "The model does not support this endpoint yet."
    },
    {
      "code": "invalid_parameter",
      "status": 400,
      "description": "Nilai parameter salah bentuk. Pesan error menyebut parameternya.",
      "x-description-en": "A parameter has the wrong shape. The message names it."
    },
    {
      "code": "unsupported_parameter",
      "status": 400,
      "description": "Nilai tidak didukung model ini. Pesan error memuat pilihan yang didukung.",
      "x-description-en": "The value is not supported by this model. The message lists what is."
    },
    {
      "code": "missing_required_parameter",
      "status": 400,
      "description": "Parameter wajib tidak diisi.",
      "x-description-en": "A required parameter is missing."
    },
    {
      "code": "missing_prompt",
      "status": 400,
      "description": "prompt kosong.",
      "x-description-en": "prompt is empty."
    },
    {
      "code": "prompt_too_long",
      "status": 400,
      "description": "prompt melebihi batas karakter.",
      "x-description-en": "prompt is over the character limit."
    },
    {
      "code": "invalid_n",
      "status": 400,
      "description": "n harus bilangan bulat 1 sampai 4.",
      "x-description-en": "n must be an integer from 1 to 4."
    },
    {
      "code": "invalid_input_references",
      "status": 400,
      "description": "input_references salah bentuk atau terlalu banyak.",
      "x-description-en": "input_references is malformed or has too many items."
    },
    {
      "code": "missing_input",
      "status": 400,
      "description": "input kosong.",
      "x-description-en": "input is empty."
    },
    {
      "code": "input_too_long",
      "status": 400,
      "description": "input melebihi batas karakter. Pecah teks menjadi beberapa request.",
      "x-description-en": "input is over the character limit. Split the text into several requests."
    },
    {
      "code": "invalid_multipart",
      "status": 400,
      "description": "Body multipart/form-data rusak.",
      "x-description-en": "The multipart/form-data body is malformed."
    },
    {
      "code": "missing_file",
      "status": 400,
      "description": "Field file tidak ada atau kosong.",
      "x-description-en": "The file field is missing or empty."
    },
    {
      "code": "missing_audio",
      "status": 400,
      "description": "input_audio tidak ada atau kosong.",
      "x-description-en": "input_audio is missing or empty."
    },
    {
      "code": "invalid_audio",
      "status": 400,
      "description": "input_audio.data bukan base64 yang valid.",
      "x-description-en": "input_audio.data is not valid base64."
    },
    {
      "code": "invalid_audio_url",
      "status": 400,
      "description": "input_audio.url bukan URL http(s) yang valid.",
      "x-description-en": "input_audio.url is not a valid http(s) URL."
    },
    {
      "code": "unsupported_format",
      "status": 400,
      "description": "Format audio tidak didukung.",
      "x-description-en": "The audio format is not supported."
    },
    {
      "code": "audio_too_long",
      "status": 400,
      "description": "Rekaman terlalu panjang. Potong menjadi beberapa file.",
      "x-description-en": "The recording is too long. Split it into several files."
    },
    {
      "code": "file_too_large",
      "status": 413,
      "description": "File audio lebih dari 25 MB.",
      "x-description-en": "The audio file is over 25 MB."
    },
    {
      "code": "media_rate_limited",
      "status": 429,
      "retry": true,
      "description": "Batas jumlah gambar, suara, atau video per rentang waktu tercapai. Tunggu sesuai header Retry-After.",
      "x-description-en": "The limit on images, speech or video per time window was reached. Wait as told by the Retry-After header."
    },
    {
      "code": "rate_limit_exceeded",
      "status": 429,
      "retry": true,
      "description": "Model sedang sibuk. Saldo tidak dipotong; coba lagi beberapa detik kemudian (tanpa header Retry-After).",
      "x-description-en": "The model is busy. Nothing was charged; try again a few seconds later (no Retry-After header)."
    },
    {
      "code": "video_requires_topup",
      "status": 403,
      "description": "Video hanya untuk akun yang sudah pernah top-up.",
      "x-description-en": "Video is only for accounts that have topped up at least once."
    },
    {
      "code": "upstream_invalid_request",
      "status": 400,
      "description": "Model menolak isi request. Saldo tidak dipotong.",
      "x-description-en": "The model refused the request. Nothing was charged."
    },
    {
      "code": "upstream_rejected",
      "status": 400,
      "description": "Model video menolak request. Saldo tidak dipotong.",
      "x-description-en": "The video model refused the request. Nothing was charged."
    },
    {
      "code": "upstream_no_output",
      "status": 502,
      "retry": true,
      "description": "Model tidak mengembalikan hasil. Saldo tidak dipotong.",
      "x-description-en": "The model returned no output. Nothing was charged."
    },
    {
      "code": "upstream_output_too_large",
      "status": 502,
      "description": "Hasil dari model melebihi batas ukuran. Perpendek input.",
      "x-description-en": "The model’s output is over the size limit. Shorten the input."
    },
    {
      "code": "upstream_error",
      "status": 502,
      "retry": true,
      "description": "Model sedang bermasalah. Saldo tidak dipotong.",
      "x-description-en": "The model is having trouble. Nothing was charged."
    },
    {
      "code": "upstream_timeout",
      "status": 504,
      "retry": true,
      "description": "Model tidak menjawab tepat waktu. Saldo tidak dipotong.",
      "x-description-en": "The model did not answer in time. Nothing was charged."
    },
    {
      "code": "generation_failed",
      "status": 500,
      "description": "Gagal memproses hasil. Cek GET /generations sebelum mengulang.",
      "x-description-en": "Processing the output failed. Check GET /generations before retrying."
    },
    {
      "code": "generation_not_found",
      "status": 404,
      "description": "ID tidak ada, atau milik akun lain.",
      "x-description-en": "The ID does not exist, or belongs to another account."
    },
    {
      "code": "generation_not_completed",
      "status": 409,
      "description": "Video belum selesai. Pantau statusnya dulu.",
      "x-description-en": "The video is not ready. Follow its status first."
    },
    {
      "code": "content_expired",
      "status": 410,
      "description": "File sudah dihapus karena melewati masa simpan.",
      "x-description-en": "The file was deleted because its retention period ended."
    },
    {
      "code": "content_unavailable",
      "status": 404,
      "description": "File hasil tidak tersedia.",
      "x-description-en": "The output file is not available."
    },
    {
      "code": "content_not_found",
      "status": 404,
      "description": "Nomor file (index) tidak ada.",
      "x-description-en": "That file number (index) does not exist."
    },
    {
      "code": "delivery_failed",
      "status": 200,
      "description": "Muncul di generation.error: hasil sudah dibuat tetapi gagal disimpan. Hubungi support dengan ID-nya.",
      "x-description-en": "Appears in generation.error: the output was made but could not be stored. Contact support with the ID."
    }
  ]
}