Execute AI model

This endpoint provides users with the capability to run specific AI models on-demand. By submitting the required input data, users can receive real-time predictions or results generated by the chosen AI model. The endpoint supports various AI model types, ensuring flexibility and adaptability for diverse use cases.

/accounts/{account_identifier}/ai/run/{model_name}

post

Workers AI

workers-ai-post-run-model

Debug "planAvailability"

{
  "business": true,
  "enterprise": true,
  "free": true,
  "pro": true
}

Debug "tokenPermissions"

{
  "enum": [
    "com.cloudflare.api.account.ai"
  ]
}

Debug "parameters"

[
  {
    "in": "path",
    "name": "account_identifier",
    "required": true,
    "schema": {
      "example": "023e105f4ecef8ad9ca31a8372d0c353",
      "type": "string"
    }
  },
  {
    "in": "path",
    "name": "model_name",
    "required": true,
    "schema": {
      "type": "string"
    }
  }
]

Debug "requestBody"

{
  "content": {
    "application/json": {
      "schema": {
        "type": "object"
      }
    },
    "application/octet-stream": {
      "schema": {
        "format": "binary",
        "type": "string"
      }
    }
  }
}

Debug "responses"

{
  "200": {
    "content": {
      "application/json": {
        "schema": {
          "properties": {
            "errors": {
              "items": {
                "properties": {
                  "message": {
                    "type": "string"
                  }
                },
                "required": [
                  "message"
                ],
                "type": "object"
              },
              "type": "array"
            },
            "messages": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "result": {
              "type": "object"
            },
            "success": {
              "example": true,
              "type": "boolean"
            }
          },
          "required": [
            "result",
            "success",
            "errors",
            "messages"
          ],
          "type": "object"
        }
      }
    },
    "description": "Model response"
  },
  "400": {
    "content": {
      "application/json": {
        "schema": {
          "properties": {
            "errors": {
              "items": {
                "properties": {
                  "message": {
                    "type": "string"
                  }
                },
                "required": [
                  "message"
                ],
                "type": "object"
              },
              "type": "array"
            },
            "result": {
              "type": "object"
            },
            "success": {
              "example": false,
              "type": "boolean"
            }
          },
          "required": [
            "result",
            "success",
            "errors"
          ],
          "type": "object"
        }
      }
    },
    "description": "Bad Request"
  }
}

Debug "security"

[
  {
    "api_email": [],
    "api_key": []
  }
]