{
  "openapi": "3.1.0",
  "info": {
    "title": "Random Image & Placeholder API",
    "version": "1.0.0",
    "description": "Placeholder images as SVG with solid or gradient backgrounds, a label and automatic contrast text.\n\nGenerate placeholder images as SVG — solid or gradient backgrounds, a centered label, and automatic contrast text. Pick exact colors and size, or use the random-color mode. Returns an SVG that drops straight into an <img> tag.",
    "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/random-image.webp"
    }
  },
  "externalDocs": {
    "description": "Documentation, live tester and pricing",
    "url": "https://dataandapis.com/apis/random-image"
  },
  "servers": [
    {
      "url": "https://api-random-image.dataandapis.com"
    }
  ],
  "tags": [
    {
      "name": "Utilities",
      "description": "Random Image & Placeholder API belongs to the Utilities category of the Data and APIs catalog."
    }
  ],
  "paths": {
    "/v1/image": {
      "get": {
        "operationId": "placeholderImage",
        "summary": "Placeholder Image",
        "description": "Placeholder Image endpoint of the Random Image & Placeholder API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/random-image/placeholder-image"
        },
        "parameters": [
          {
            "name": "bg",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "cccccc"
          },
          {
            "name": "color",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "333333"
          },
          {
            "name": "gradient",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "eeeeee"
          },
          {
            "name": "height",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "400"
          },
          {
            "name": "text",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "Hello"
          },
          {
            "name": "width",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "600"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "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": []
          }
        ]
      }
    },
    "/v1/image/random": {
      "get": {
        "operationId": "randomImage",
        "summary": "Random Image",
        "description": "Random Image endpoint of the Random Image & Placeholder API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/random-image/random-image"
        },
        "parameters": [
          {
            "name": "gradient",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "true"
          },
          {
            "name": "height",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "300"
          },
          {
            "name": "width",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "800"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "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 1 token per call."
      }
    }
  },
  "security": [
    {
      "ApiKey": []
    }
  ]
}