{
  "openapi": "3.0.3",
  "info": {
    "title": "BeefAPI Global API",
    "version": "2026-09-07",
    "description": "Global text, image, video, and account APIs. Use a key issued on this site and prepaid USD credit."
  },
  "servers": [
    {
      "url": "https://global.beefapi.com"
    }
  ],
  "externalDocs": {
    "url": "https://global.beefapi.com/docs"
  },
  "paths": {
    "/v1/models": {
      "get": {
        "tags": [
          "Models"
        ],
        "summary": "List available models for an API key",
        "operationId": "listModels",
        "security": [
          {},
          {
            "BeefAPIKeyBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "OpenAI-compatible model list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "description": "Without a key, returns the public catalog. Authenticated listings reflect key permissions but do not guarantee immediate capacity."
      }
    },
    "/v1/chat/completions": {
      "post": {
        "tags": [
          "OpenAI Compatible"
        ],
        "summary": "Create an OpenAI-compatible Chat Completions request",
        "description": "Compatibility path. For new OpenAI/Codex-style integrations, prefer /v1/responses when supported by the client.",
        "operationId": "createChatCompletion",
        "security": [
          {
            "BeefAPIKeyBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "messages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "role": {
                          "type": "string"
                        },
                        "content": {}
                      },
                      "required": [
                        "role",
                        "content"
                      ]
                    }
                  },
                  "stream": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "model",
                  "messages"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Chat completion result or stream.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/v1/responses": {
      "post": {
        "tags": [
          "OpenAI Compatible"
        ],
        "summary": "Create an OpenAI-compatible Responses API request",
        "operationId": "createResponse",
        "security": [
          {
            "BeefAPIKeyBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OpenAIResponsesRequest"
              },
              "examples": {
                "basic": {
                  "value": {
                    "model": "gpt-5.5",
                    "input": "Reply in one short sentence.",
                    "stream": false
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Responses API result or stream.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/v1/messages": {
      "post": {
        "tags": [
          "Anthropic Compatible"
        ],
        "summary": "Create an Anthropic-compatible Messages request",
        "operationId": "createAnthropicMessage",
        "security": [
          {
            "AnthropicAPIKey": []
          }
        ],
        "parameters": [
          {
            "name": "anthropic-version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "example": "2023-06-01"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "messages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "role": {
                          "type": "string"
                        },
                        "content": {}
                      },
                      "required": [
                        "role",
                        "content"
                      ]
                    }
                  },
                  "max_tokens": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "stream": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "model",
                  "messages",
                  "max_tokens"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Anthropic Messages-compatible result or stream.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/pricing.usd.json": {
      "get": {
        "operationId": "getGlobalUSDPrices",
        "summary": "Read current global USD base prices",
        "responses": {
          "200": {
            "description": "Same pricebook as /pricing; final usage and applicable adjustments determine the charge.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GlobalUSDPricebook"
                }
              }
            }
          }
        }
      }
    },
    "/v1/images/generations": {
      "post": {
        "operationId": "generateImage",
        "tags": [
          "Images"
        ],
        "security": [
          {
            "BeefAPIKeyBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Completed image. Save promptly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImageResponse"
                }
              }
            }
          },
          "400": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/images/generations/jobs": {
      "post": {
        "operationId": "submitImageGenerationJob",
        "tags": [
          "Images"
        ],
        "security": [
          {
            "BeefAPIKeyBearer": []
          }
        ],
        "description": "Optional; not supported on every image route. After a definitive unsupported-route error, use the synchronous endpoint. A timed-out submit may still be running.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImageRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted; save job_id and poll.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImageJob"
                }
              }
            }
          },
          "400": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/images/edits": {
      "post": {
        "operationId": "editImage",
        "tags": [
          "Images"
        ],
        "security": [
          {
            "BeefAPIKeyBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImageEditRequest"
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "example": "gpt-image-2"
                  },
                  "prompt": {
                    "type": "string",
                    "description": "Description of the image or edit."
                  },
                  "n": {
                    "type": "integer",
                    "enum": [
                      1
                    ],
                    "default": 1
                  },
                  "size": {
                    "type": "string",
                    "description": "Start with 1024x1024. Other sizes depend on the route."
                  },
                  "quality": {
                    "type": "string",
                    "enum": [
                      "auto",
                      "low",
                      "medium",
                      "high"
                    ],
                    "description": "Optional; support depends on the route."
                  },
                  "response_format": {
                    "type": "string",
                    "enum": [
                      "url",
                      "b64_json"
                    ]
                  },
                  "image": {
                    "type": "string",
                    "format": "binary"
                  }
                },
                "required": [
                  "model",
                  "prompt",
                  "image"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Completed image. Save promptly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImageResponse"
                }
              }
            }
          },
          "400": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/images/edits/jobs": {
      "post": {
        "operationId": "submitImageEditJob",
        "tags": [
          "Images"
        ],
        "security": [
          {
            "BeefAPIKeyBearer": []
          }
        ],
        "description": "Optional; not supported on every image route. After a definitive unsupported-route error, use the synchronous endpoint. A timed-out submit may still be running.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImageEditRequest"
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "example": "gpt-image-2"
                  },
                  "prompt": {
                    "type": "string",
                    "description": "Description of the image or edit."
                  },
                  "n": {
                    "type": "integer",
                    "enum": [
                      1
                    ],
                    "default": 1
                  },
                  "size": {
                    "type": "string",
                    "description": "Start with 1024x1024. Other sizes depend on the route."
                  },
                  "quality": {
                    "type": "string",
                    "enum": [
                      "auto",
                      "low",
                      "medium",
                      "high"
                    ],
                    "description": "Optional; support depends on the route."
                  },
                  "response_format": {
                    "type": "string",
                    "enum": [
                      "url",
                      "b64_json"
                    ]
                  },
                  "image": {
                    "type": "string",
                    "format": "binary"
                  }
                },
                "required": [
                  "model",
                  "prompt",
                  "image"
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted; save job_id and poll.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImageJob"
                }
              }
            }
          },
          "400": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/images/jobs/{job_id}": {
      "get": {
        "operationId": "getImageJob",
        "security": [
          {
            "BeefAPIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Inspect status even when HTTP is 200.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImageJob"
                }
              }
            }
          },
          "400": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Job not found for this account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/images/jobs/{job_id}/result": {
      "get": {
        "operationId": "getImageJobResult",
        "security": [
          {
            "BeefAPIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "response_format",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "url",
                "b64_json"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Completed image.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImageResponse"
                }
              }
            }
          },
          "400": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Job is not completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/videos": {
      "post": {
        "operationId": "createVideo",
        "tags": [
          "Videos"
        ],
        "security": [
          {
            "BeefAPIKeyBearer": []
          }
        ],
        "description": "Create once, poll the returned id, then download. Global edits, remix, and extensions are not offered.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VideoRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Task accepted, not a finished video.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VideoTask"
                }
              }
            }
          },
          "400": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/videos/generations": {
      "post": {
        "operationId": "createVideoAlias",
        "tags": [
          "Videos"
        ],
        "security": [
          {
            "BeefAPIKeyBearer": []
          }
        ],
        "description": "Create once, poll the returned id, then download. Global edits, remix, and extensions are not offered.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VideoRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Task accepted, not a finished video.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VideoTask"
                }
              }
            }
          },
          "400": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/videos/{task_id}": {
      "get": {
        "operationId": "getVideo",
        "security": [
          {
            "BeefAPIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Task status; failed tasks include error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VideoTask"
                }
              }
            }
          },
          "400": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/videos/{task_id}/content": {
      "get": {
        "operationId": "downloadVideo",
        "security": [
          {
            "BeefAPIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Video bytes.",
            "content": {
              "video/mp4": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "302": {
            "description": "Short-lived URL. Follow without forwarding credentials across hosts.",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Request failed; inspect error and HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/user/self": {
      "get": {
        "operationId": "getGlobalAccount",
        "security": [
          {
            "SystemAccessToken": [],
            "AccountUserID": []
          }
        ],
        "responses": {
          "200": {
            "description": "Account envelope; quota is accounting units, not USD.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "required": []
                }
              }
            }
          },
          "401": {
            "description": "Invalid system access token or user ID."
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "error": {
            "type": "object",
            "additionalProperties": true
          },
          "message": {
            "type": "string"
          }
        }
      },
      "OpenAIResponsesRequest": {
        "type": "object",
        "required": [
          "model",
          "input"
        ],
        "additionalProperties": true,
        "properties": {
          "model": {
            "type": "string"
          },
          "input": {},
          "stream": {
            "type": "boolean"
          },
          "max_output_tokens": {
            "type": "integer"
          }
        }
      },
      "ImageRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "example": "gpt-image-2"
          },
          "prompt": {
            "type": "string",
            "description": "Description of the image or edit."
          },
          "n": {
            "type": "integer",
            "enum": [
              1
            ],
            "default": 1
          },
          "size": {
            "type": "string",
            "description": "Start with 1024x1024. Other sizes depend on the route."
          },
          "quality": {
            "type": "string",
            "enum": [
              "auto",
              "low",
              "medium",
              "high"
            ],
            "description": "Optional; support depends on the route."
          },
          "response_format": {
            "type": "string",
            "enum": [
              "url",
              "b64_json"
            ]
          }
        },
        "required": [
          "model",
          "prompt"
        ]
      },
      "ImageEditRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "example": "gpt-image-2"
          },
          "prompt": {
            "type": "string",
            "description": "Description of the image or edit."
          },
          "n": {
            "type": "integer",
            "enum": [
              1
            ],
            "default": 1
          },
          "size": {
            "type": "string",
            "description": "Start with 1024x1024. Other sizes depend on the route."
          },
          "quality": {
            "type": "string",
            "enum": [
              "auto",
              "low",
              "medium",
              "high"
            ],
            "description": "Optional; support depends on the route."
          },
          "response_format": {
            "type": "string",
            "enum": [
              "url",
              "b64_json"
            ]
          },
          "image": {
            "type": "string",
            "description": "Public HTTPS image URL or complete data URL."
          }
        },
        "required": [
          "model",
          "prompt",
          "image"
        ]
      },
      "ImageResponse": {
        "type": "object",
        "properties": {
          "created": {
            "type": "integer"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string"
                },
                "b64_json": {
                  "type": "string",
                  "description": "Base64 encoded image bytes."
                }
              },
              "required": []
            }
          }
        },
        "required": [
          "created",
          "data"
        ]
      },
      "ImageJob": {
        "type": "object",
        "properties": {
          "job_id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "in_progress",
              "completed",
              "failed"
            ]
          },
          "progress": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "properties": {
              "url": {
                "type": "string"
              }
            },
            "required": []
          },
          "error": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              },
              "code": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "required": [
          "job_id",
          "status"
        ]
      },
      "VideoRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "enum": [
              "grok-imagine-video-1.5"
            ]
          },
          "prompt": {
            "type": "string"
          },
          "duration": {
            "type": "integer",
            "minimum": 1,
            "maximum": 15,
            "default": 4,
            "description": "Reference mode is limited to 10 seconds."
          },
          "resolution": {
            "type": "string",
            "enum": [
              "480p",
              "720p",
              "1080p"
            ],
            "default": "480p",
            "description": "Reference mode is limited to 720p."
          },
          "aspect_ratio": {
            "type": "string",
            "enum": [
              "1:1",
              "16:9",
              "9:16",
              "4:3",
              "3:4",
              "3:2",
              "2:3"
            ],
            "default": "16:9"
          },
          "generate_audio": {
            "type": "boolean",
            "description": "Explicit false requests silence; omission uses the model default."
          },
          "image": {
            "oneOf": [
              {
                "type": "string",
                "description": "Public HTTPS URL or data URL."
              },
              {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string"
                  }
                },
                "required": [
                  "url"
                ]
              }
            ]
          },
          "reference_images": {
            "type": "array",
            "maxItems": 7,
            "items": {
              "oneOf": [
                {
                  "type": "string",
                  "description": "Public HTTPS URL or data URL."
                },
                {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "url"
                  ]
                }
              ]
            },
            "description": "Do not combine with image."
          },
          "reference_audios": {
            "type": "array",
            "maxItems": 3,
            "items": {
              "type": "object",
              "properties": {
                "voice_id": {
                  "type": "string"
                }
              },
              "required": [
                "voice_id"
              ]
            },
            "description": "Preset voices only; activates reference-mode limits."
          }
        },
        "required": [
          "model",
          "prompt"
        ]
      },
      "VideoTask": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "in_progress",
              "completed",
              "failed"
            ]
          },
          "created_at": {
            "type": "integer"
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "required": [
          "id",
          "status"
        ]
      },
      "GlobalUSDPricebook": {
        "type": "object",
        "properties": {
          "pricebook_id": {
            "type": "string"
          },
          "pricing_version": {
            "type": "string"
          },
          "models": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "model_name": {
                  "type": "string"
                },
                "mode": {
                  "type": "string",
                  "enum": [
                    "token",
                    "per_request"
                  ]
                },
                "unit": {
                  "type": "string",
                  "enum": [
                    "image",
                    "second",
                    "request"
                  ]
                },
                "input_usd": {
                  "type": "number"
                },
                "output_usd": {
                  "type": "number"
                },
                "cache_read_usd": {
                  "type": "number"
                },
                "cache_write_usd": {
                  "type": "number"
                },
                "per_request_usd": {
                  "type": "number",
                  "description": "Price per unit; video base is one 480p second."
                },
                "per_second_usd": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "number"
                  }
                },
                "reference_image_usd": {
                  "type": "number"
                }
              },
              "required": [
                "model_name",
                "mode"
              ]
            }
          }
        },
        "required": [
          "pricebook_id",
          "pricing_version",
          "models"
        ]
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Missing, invalid, expired, or unauthorized API key.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "BeefAPIKeyBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "BeefAPI API key",
        "description": "Use Authorization: Bearer sk-..."
      },
      "AnthropicAPIKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "Use a BeefAPI sk-... API key."
      },
      "SystemAccessToken": {
        "type": "http",
        "scheme": "bearer",
        "description": "System access token from Account settings, not an sk- API key."
      },
      "AccountUserID": {
        "type": "apiKey",
        "in": "header",
        "name": "New-Api-User"
      }
    }
  }
}
