{
  "openapi": "3.1.0",
  "info": {
    "title": "AI Image Studio API",
    "version": "v1",
    "description": "Generate images and videos with the models this site offers, billed from your account's credits at the site's prices. Available to accounts that have made a purchase. Responses are { success, data } or { success: false, error: { code, message, request_id } }."
  },
  "servers": [
    {
      "url": "https://ai-image.studio"
    }
  ],
  "security": [
    {
      "bearer": []
    }
  ],
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "An API key (bnt_…) from your account page, or an OAuth access token"
      }
    }
  },
  "paths": {
    "/api/v1/models": {
      "get": {
        "operationId": "listModels",
        "summary": "Models this site offers",
        "x-mcp-tool": "list_models",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "slug": {
                                "type": "string",
                                "description": "Use as `model` when generating"
                              },
                              "name": {
                                "type": "string"
                              },
                              "summary": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "media_types": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "enum": [
                                    "image",
                                    "video"
                                  ]
                                }
                              },
                              "capability_types": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "enum": [
                                    "t2i",
                                    "i2i",
                                    "t2v",
                                    "i2v"
                                  ],
                                  "description": "t2i = text to image, i2i = image to image, t2v = text to video, i2v = image to video"
                                }
                              },
                              "inputs": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "enum": [
                                    "image",
                                    "video",
                                    "audio"
                                  ]
                                },
                                "description": "Reference media this model accepts"
                              },
                              "requires_premium": {
                                "type": "boolean",
                                "description": "Needs subscription or purchased credits, not free credits"
                              },
                              "credits": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "min": {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991,
                                      "description": "Credits for the cheapest parameter choice"
                                    },
                                    "max": {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991,
                                      "description": "Credits for the most expensive parameter choice"
                                    },
                                    "capability_type": {
                                      "type": "string",
                                      "enum": [
                                        "t2i",
                                        "i2i",
                                        "t2v",
                                        "i2v"
                                      ],
                                      "description": "t2i = text to image, i2i = image to image, t2v = text to video, i2v = image to video"
                                    }
                                  },
                                  "required": [
                                    "min",
                                    "max",
                                    "capability_type"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "slug",
                              "name",
                              "summary",
                              "media_types",
                              "capability_types",
                              "inputs",
                              "requires_premium",
                              "credits"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "items"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "VALIDATION_ERROR",
                            "INVALID_PARAMS",
                            "INVALID_MODEL",
                            "MODERATION_BLOCKED",
                            "UNAUTHORIZED",
                            "INVALID_TOKEN",
                            "TOKEN_EXPIRED",
                            "PAYMENT_REQUIRED",
                            "USER_BANNED",
                            "INSUFFICIENT_CREDITS",
                            "PREMIUM_CREDITS_REQUIRED",
                            "DAILY_CAP_REACHED",
                            "MODEL_NOT_AVAILABLE",
                            "NOT_FOUND",
                            "BATCH_NOT_FOUND",
                            "PRICE_CHANGED",
                            "IDEMPOTENCY_MISMATCH",
                            "RATE_LIMITED",
                            "INTERNAL_ERROR",
                            "SERVICE_OVERLOADED",
                            "SERVICE_UNAVAILABLE"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        "request_id": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "request_id"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/models/{slug}": {
      "get": {
        "operationId": "getModel",
        "summary": "One model and its parameters",
        "x-mcp-tool": "get_model_params",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "slug": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "requires_premium": {
                          "type": "boolean"
                        },
                        "capabilities": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "t2i",
                                  "i2i",
                                  "t2v",
                                  "i2v"
                                ],
                                "description": "t2i = text to image, i2i = image to image, t2v = text to video, i2v = image to video"
                              },
                              "media_type": {
                                "type": "string",
                                "enum": [
                                  "image",
                                  "video"
                                ]
                              },
                              "credits": {
                                "type": "object",
                                "properties": {
                                  "min": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991,
                                    "description": "Credits for the cheapest parameter choice"
                                  },
                                  "max": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991,
                                    "description": "Credits for the most expensive parameter choice"
                                  }
                                },
                                "required": [
                                  "min",
                                  "max"
                                ],
                                "additionalProperties": false
                              },
                              "params": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "name": {
                                      "type": "string"
                                    },
                                    "type": {
                                      "type": "string"
                                    },
                                    "required": {
                                      "type": "boolean"
                                    },
                                    "options": {
                                      "anyOf": [
                                        {
                                          "type": "array",
                                          "items": {
                                            "type": "string"
                                          }
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "min": {
                                      "anyOf": [
                                        {
                                          "type": "number"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "max": {
                                      "anyOf": [
                                        {
                                          "type": "number"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "max_length": {
                                      "anyOf": [
                                        {
                                          "type": "integer",
                                          "minimum": -9007199254740991,
                                          "maximum": 9007199254740991
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "max_count": {
                                      "anyOf": [
                                        {
                                          "type": "integer",
                                          "minimum": -9007199254740991,
                                          "maximum": 9007199254740991
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "default": {
                                      "anyOf": [
                                        {},
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    }
                                  },
                                  "required": [
                                    "name",
                                    "type",
                                    "required",
                                    "options",
                                    "min",
                                    "max",
                                    "max_length",
                                    "max_count",
                                    "default"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "type",
                              "media_type",
                              "credits",
                              "params"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "slug",
                        "name",
                        "requires_premium",
                        "capabilities"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "VALIDATION_ERROR",
                            "INVALID_PARAMS",
                            "INVALID_MODEL",
                            "MODERATION_BLOCKED",
                            "UNAUTHORIZED",
                            "INVALID_TOKEN",
                            "TOKEN_EXPIRED",
                            "PAYMENT_REQUIRED",
                            "USER_BANNED",
                            "INSUFFICIENT_CREDITS",
                            "PREMIUM_CREDITS_REQUIRED",
                            "DAILY_CAP_REACHED",
                            "MODEL_NOT_AVAILABLE",
                            "NOT_FOUND",
                            "BATCH_NOT_FOUND",
                            "PRICE_CHANGED",
                            "IDEMPOTENCY_MISMATCH",
                            "RATE_LIMITED",
                            "INTERNAL_ERROR",
                            "SERVICE_OVERLOADED",
                            "SERVICE_UNAVAILABLE"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        "request_id": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "request_id"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/quote": {
      "post": {
        "operationId": "quote",
        "summary": "Price of a generation, without running it",
        "x-mcp-tool": "estimate_cost",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "description": "A model slug from GET /api/v1/models"
                  },
                  "capability_type": {
                    "type": "string",
                    "enum": [
                      "t2i",
                      "i2i",
                      "t2v",
                      "i2v"
                    ],
                    "description": "t2i = text to image, i2i = image to image, t2v = text to video, i2v = image to video"
                  },
                  "prompt": {
                    "description": "Shorthand for params.prompt",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 10000
                  },
                  "params": {
                    "default": {},
                    "description": "Model parameters, see GET /api/v1/models/{slug}",
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  },
                  "reference_urls": {
                    "default": [],
                    "description": "https URLs of reference images / videos (image-to-image, image-to-video)",
                    "maxItems": 16,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 2048,
                      "format": "uri",
                      "pattern": "^https:\\/\\/.*"
                    }
                  }
                },
                "required": [
                  "model",
                  "capability_type"
                ],
                "additionalProperties": false
              },
              "example": {
                "model": "gpt-image-2",
                "capability_type": "t2i",
                "prompt": "a paper fox in fresh snow"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "model": {
                          "type": "string"
                        },
                        "capability_type": {
                          "type": "string",
                          "enum": [
                            "t2i",
                            "i2i",
                            "t2v",
                            "i2v"
                          ],
                          "description": "t2i = text to image, i2i = image to image, t2v = text to video, i2v = image to video"
                        },
                        "credits": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "output_count": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "params": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {},
                          "description": "Parameters after defaults were applied"
                        },
                        "requires_premium": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "model",
                        "capability_type",
                        "credits",
                        "output_count",
                        "params",
                        "requires_premium"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "VALIDATION_ERROR",
                            "INVALID_PARAMS",
                            "INVALID_MODEL",
                            "MODERATION_BLOCKED",
                            "UNAUTHORIZED",
                            "INVALID_TOKEN",
                            "TOKEN_EXPIRED",
                            "PAYMENT_REQUIRED",
                            "USER_BANNED",
                            "INSUFFICIENT_CREDITS",
                            "PREMIUM_CREDITS_REQUIRED",
                            "DAILY_CAP_REACHED",
                            "MODEL_NOT_AVAILABLE",
                            "NOT_FOUND",
                            "BATCH_NOT_FOUND",
                            "PRICE_CHANGED",
                            "IDEMPOTENCY_MISMATCH",
                            "RATE_LIMITED",
                            "INTERNAL_ERROR",
                            "SERVICE_OVERLOADED",
                            "SERVICE_UNAVAILABLE"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        "request_id": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "request_id"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/generations": {
      "post": {
        "operationId": "createGeneration",
        "summary": "Start an image or video generation",
        "x-mcp-tool": "generate",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_.:-]{1,64}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "description": "A model slug from GET /api/v1/models"
                  },
                  "capability_type": {
                    "type": "string",
                    "enum": [
                      "t2i",
                      "i2i",
                      "t2v",
                      "i2v"
                    ],
                    "description": "t2i = text to image, i2i = image to image, t2v = text to video, i2v = image to video"
                  },
                  "prompt": {
                    "description": "Shorthand for params.prompt",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 10000
                  },
                  "params": {
                    "default": {},
                    "description": "Model parameters, see GET /api/v1/models/{slug}",
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  },
                  "reference_urls": {
                    "default": [],
                    "description": "https URLs of reference images / videos (image-to-image, image-to-video)",
                    "maxItems": 16,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 2048,
                      "format": "uri",
                      "pattern": "^https:\\/\\/.*"
                    }
                  },
                  "max_credits": {
                    "description": "Refuse with 409 PRICE_CHANGED if the price is now higher than this",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "model",
                  "capability_type"
                ],
                "additionalProperties": false
              },
              "example": {
                "model": "gpt-image-2",
                "capability_type": "t2i",
                "prompt": "a paper fox in fresh snow"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "16-character id"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "queued",
                            "running",
                            "succeeded",
                            "failed"
                          ],
                          "description": "queued → running → succeeded | failed. Partial results are `succeeded` with fewer outputs."
                        },
                        "model": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "capability_type": {
                          "type": "string"
                        },
                        "type": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "image",
                                "video"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "prompt": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "params": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        "outputs": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "image",
                                  "video",
                                  "audio"
                                ]
                              },
                              "url": {
                                "type": "string",
                                "format": "uri"
                              },
                              "mime": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "width": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "height": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "duration_s": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "type",
                              "url",
                              "mime",
                              "width",
                              "height",
                              "duration_s"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "credits_quoted": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Price of this generation. Failed outputs are refunded automatically; see your balance."
                        },
                        "error": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "code": {
                                  "type": "string"
                                },
                                "message": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "code",
                                "message"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "created_at": {
                          "type": "string",
                          "description": "ISO 8601 UTC"
                        }
                      },
                      "required": [
                        "id",
                        "status",
                        "model",
                        "capability_type",
                        "type",
                        "prompt",
                        "params",
                        "outputs",
                        "credits_quoted",
                        "error",
                        "created_at"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "VALIDATION_ERROR",
                            "INVALID_PARAMS",
                            "INVALID_MODEL",
                            "MODERATION_BLOCKED",
                            "UNAUTHORIZED",
                            "INVALID_TOKEN",
                            "TOKEN_EXPIRED",
                            "PAYMENT_REQUIRED",
                            "USER_BANNED",
                            "INSUFFICIENT_CREDITS",
                            "PREMIUM_CREDITS_REQUIRED",
                            "DAILY_CAP_REACHED",
                            "MODEL_NOT_AVAILABLE",
                            "NOT_FOUND",
                            "BATCH_NOT_FOUND",
                            "PRICE_CHANGED",
                            "IDEMPOTENCY_MISMATCH",
                            "RATE_LIMITED",
                            "INTERNAL_ERROR",
                            "SERVICE_OVERLOADED",
                            "SERVICE_UNAVAILABLE"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        "request_id": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "request_id"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listGenerations",
        "summary": "Your generations, newest first",
        "x-mcp-tool": "list_generations",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 20,
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "description": "16-character id"
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "queued",
                                  "running",
                                  "succeeded",
                                  "failed"
                                ],
                                "description": "queued → running → succeeded | failed. Partial results are `succeeded` with fewer outputs."
                              },
                              "model": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "capability_type": {
                                "type": "string"
                              },
                              "type": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "enum": [
                                      "image",
                                      "video"
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "prompt": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "params": {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {}
                              },
                              "outputs": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "enum": [
                                        "image",
                                        "video",
                                        "audio"
                                      ]
                                    },
                                    "url": {
                                      "type": "string",
                                      "format": "uri"
                                    },
                                    "mime": {
                                      "anyOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "width": {
                                      "anyOf": [
                                        {
                                          "type": "integer",
                                          "minimum": -9007199254740991,
                                          "maximum": 9007199254740991
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "height": {
                                      "anyOf": [
                                        {
                                          "type": "integer",
                                          "minimum": -9007199254740991,
                                          "maximum": 9007199254740991
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "duration_s": {
                                      "anyOf": [
                                        {
                                          "type": "number"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "url",
                                    "mime",
                                    "width",
                                    "height",
                                    "duration_s"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "credits_quoted": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991,
                                "description": "Price of this generation. Failed outputs are refunded automatically; see your balance."
                              },
                              "error": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "code": {
                                        "type": "string"
                                      },
                                      "message": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "code",
                                      "message"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "created_at": {
                                "type": "string",
                                "description": "ISO 8601 UTC"
                              }
                            },
                            "required": [
                              "id",
                              "status",
                              "model",
                              "capability_type",
                              "type",
                              "prompt",
                              "params",
                              "outputs",
                              "credits_quoted",
                              "error",
                              "created_at"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "next_cursor": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "items",
                        "next_cursor"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "VALIDATION_ERROR",
                            "INVALID_PARAMS",
                            "INVALID_MODEL",
                            "MODERATION_BLOCKED",
                            "UNAUTHORIZED",
                            "INVALID_TOKEN",
                            "TOKEN_EXPIRED",
                            "PAYMENT_REQUIRED",
                            "USER_BANNED",
                            "INSUFFICIENT_CREDITS",
                            "PREMIUM_CREDITS_REQUIRED",
                            "DAILY_CAP_REACHED",
                            "MODEL_NOT_AVAILABLE",
                            "NOT_FOUND",
                            "BATCH_NOT_FOUND",
                            "PRICE_CHANGED",
                            "IDEMPOTENCY_MISMATCH",
                            "RATE_LIMITED",
                            "INTERNAL_ERROR",
                            "SERVICE_OVERLOADED",
                            "SERVICE_UNAVAILABLE"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        "request_id": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "request_id"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/generations/{id}": {
      "get": {
        "operationId": "getGeneration",
        "summary": "One generation and its results",
        "x-mcp-tool": "get_generation",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "16-character id"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "queued",
                            "running",
                            "succeeded",
                            "failed"
                          ],
                          "description": "queued → running → succeeded | failed. Partial results are `succeeded` with fewer outputs."
                        },
                        "model": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "capability_type": {
                          "type": "string"
                        },
                        "type": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "image",
                                "video"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "prompt": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "params": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        "outputs": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "image",
                                  "video",
                                  "audio"
                                ]
                              },
                              "url": {
                                "type": "string",
                                "format": "uri"
                              },
                              "mime": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "width": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "height": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "duration_s": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "type",
                              "url",
                              "mime",
                              "width",
                              "height",
                              "duration_s"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "credits_quoted": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Price of this generation. Failed outputs are refunded automatically; see your balance."
                        },
                        "error": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "code": {
                                  "type": "string"
                                },
                                "message": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "code",
                                "message"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "created_at": {
                          "type": "string",
                          "description": "ISO 8601 UTC"
                        }
                      },
                      "required": [
                        "id",
                        "status",
                        "model",
                        "capability_type",
                        "type",
                        "prompt",
                        "params",
                        "outputs",
                        "credits_quoted",
                        "error",
                        "created_at"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "VALIDATION_ERROR",
                            "INVALID_PARAMS",
                            "INVALID_MODEL",
                            "MODERATION_BLOCKED",
                            "UNAUTHORIZED",
                            "INVALID_TOKEN",
                            "TOKEN_EXPIRED",
                            "PAYMENT_REQUIRED",
                            "USER_BANNED",
                            "INSUFFICIENT_CREDITS",
                            "PREMIUM_CREDITS_REQUIRED",
                            "DAILY_CAP_REACHED",
                            "MODEL_NOT_AVAILABLE",
                            "NOT_FOUND",
                            "BATCH_NOT_FOUND",
                            "PRICE_CHANGED",
                            "IDEMPOTENCY_MISMATCH",
                            "RATE_LIMITED",
                            "INTERNAL_ERROR",
                            "SERVICE_OVERLOADED",
                            "SERVICE_UNAVAILABLE"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        "request_id": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "request_id"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/balance": {
      "get": {
        "operationId": "getBalance",
        "summary": "Credits and today's cap",
        "x-mcp-tool": "get_credit_balance",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "credits": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "daily_cap": {
                          "type": "object",
                          "properties": {
                            "limit": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ],
                              "description": "Credits this key / app may spend per UTC day; null = no cap"
                            },
                            "used": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "resets_at": {
                              "type": "string",
                              "description": "ISO 8601 UTC"
                            }
                          },
                          "required": [
                            "limit",
                            "used",
                            "resets_at"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "credits",
                        "daily_cap"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "VALIDATION_ERROR",
                            "INVALID_PARAMS",
                            "INVALID_MODEL",
                            "MODERATION_BLOCKED",
                            "UNAUTHORIZED",
                            "INVALID_TOKEN",
                            "TOKEN_EXPIRED",
                            "PAYMENT_REQUIRED",
                            "USER_BANNED",
                            "INSUFFICIENT_CREDITS",
                            "PREMIUM_CREDITS_REQUIRED",
                            "DAILY_CAP_REACHED",
                            "MODEL_NOT_AVAILABLE",
                            "NOT_FOUND",
                            "BATCH_NOT_FOUND",
                            "PRICE_CHANGED",
                            "IDEMPOTENCY_MISMATCH",
                            "RATE_LIMITED",
                            "INTERNAL_ERROR",
                            "SERVICE_OVERLOADED",
                            "SERVICE_UNAVAILABLE"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        "request_id": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "request_id"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    }
  }
}