{
  "openapi": "3.1.0",
  "info": {
    "title": "Image to Text API",
    "version": "1.0.0",
    "description": "Describe any image, answer questions about it or read its text with an on-platform vision model.\n\nDescribe an image, answer a question about it or read the prominent text in it with a vision-language model running on the platform. Send an image URL or POST the bytes, JPEG, PNG or WebP up to 2.5 MB. No third-party keys and no data leaves the platform.",
    "contact": {
      "name": "Data and APIs",
      "url": "https://dataandapis.com/contact"
    },
    "termsOfService": "https://dataandapis.com/terms-of-service",
    "license": {
      "name": "Data and APIs Terms of Service",
      "url": "https://dataandapis.com/terms-of-service"
    },
    "x-logo": {
      "url": "https://dataandapis.com/images/image-to-text.webp"
    }
  },
  "externalDocs": {
    "description": "Documentation, live tester and pricing",
    "url": "https://dataandapis.com/apis/image-to-text"
  },
  "servers": [
    {
      "url": "https://api-image-to-text.dataandapis.com"
    }
  ],
  "tags": [
    {
      "name": "AI",
      "description": "Image to Text API belongs to the AI category of the Data and APIs catalog."
    }
  ],
  "paths": {
    "/v1/describe": {
      "get": {
        "operationId": "describeImage",
        "summary": "Describe Image",
        "description": "Describe Image endpoint of the Image to Text API. Costs 25 tokens per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/image-to-text/describe-image"
        },
        "parameters": [
          {
            "name": "prompt",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "Describe this image in detail."
          },
          {
            "name": "url",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "https://dataandapis.com/images/cats.webp"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "prompt": "Describe this image in detail.",
                  "text": "The image features a small, cute cat figurine with a brown and white color scheme. The cat is standing on its hind legs, giving the impression of a real cat. The figurine is positioned in the center of the image, and its unique design makes it an appealing and charming decoration."
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      },
      "post": {
        "operationId": "describeImagePost",
        "summary": "Describe Image (POST)",
        "description": "Describe Image (POST) endpoint of the Image to Text API. Costs 25 tokens per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/image-to-text/describe-image-post"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "url": "https://dataandapis.com/images/cats.webp",
                "prompt": "What animal is in this picture? Answer in a few words."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "prompt": "What animal is in this picture? Answer in a few words.",
                  "text": "Cat"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key",
        "description": "Create a free key at https://dataandapis.com/sign-up. 500 tokens a month on the Free plan; this API costs 25 tokens per call."
      }
    }
  },
  "security": [
    {
      "ApiKey": []
    }
  ]
}