{
   "openapi": "3.0.0",
   "info": {
      "title": "Unified.to GENAI API",
      "version": "1.0",
      "description": "One API to Rule Them All",
      "contact": {
         "email": "hello@unified.to",
         "url": "https://unified.to/contact"
      },
      "termsOfService": "https://unified.to/tos"
   },
   "externalDocs": {
      "description": "API Documentation",
      "url": "https://docs.unified.to"
   },
   "tags": [
      {
         "name": "unifiedapi",
         "description": "Unified.to API"
      },
      {
         "name": "genai"
      },
      {
         "name": "model"
      },
      {
         "name": "prompt"
      },
      {
         "name": "embedding"
      }
   ],
   "security": [
      {
         "jwt": []
      }
   ],
   "servers": [
      {
         "url": "https://api.unified.to",
         "description": "North American data region"
      },
      {
         "url": "https://api-eu.unified.to",
         "description": "European data region"
      },
      {
         "url": "https://api-au.unified.to",
         "description": "Australian data region"
      }
   ],
   "components": {
      "securitySchemes": {
         "jwt": {
            "type": "apiKey",
            "name": "authorization",
            "in": "header"
         }
      },
      "requestBodies": {
         "GenaiPrompt": {
            "required": true,
            "content": {
               "application/json": {
                  "schema": {
                     "$ref": "#/components/schemas/GenaiPrompt"
                  }
               }
            }
         },
         "GenaiEmbedding": {
            "required": true,
            "content": {
               "application/json": {
                  "schema": {
                     "$ref": "#/components/schemas/GenaiEmbedding"
                  }
               }
            }
         }
      },
      "schemas": {
         "GenaiModel": {
            "type": "object",
            "properties": {
               "id": {
                  "type": "string"
               },
               "name": {
                  "type": "string"
               },
               "description": {
                  "type": "string"
               },
               "max_tokens": {
                  "type": "number"
               },
               "web_url": {
                  "type": "string"
               },
               "has_temperature": {
                  "type": "boolean"
               },
               "raw": {
                  "type": "object",
                  "additionalProperties": true
               }
            }
         },
         "GenaiModels": {
            "type": "array",
            "items": {
               "$ref": "#/components/schemas/GenaiModel"
            }
         },
         "GenaiContent": {
            "type": "object",
            "properties": {
               "role": {
                  "type": "string",
                  "enum": [
                     "SYSTEM",
                     "USER",
                     "ASSISTANT"
                  ],
                  "x-speakeasy-unknown-values": "allow"
               },
               "content": {
                  "type": "string"
               }
            },
            "required": [
               "content"
            ]
         },
         "property_GenaiPrompt_messages": {
            "type": "array",
            "items": {
               "$ref": "#/components/schemas/GenaiContent"
            }
         },
         "property_GenaiPrompt_responses": {
            "type": "array",
            "items": {
               "type": "string"
            }
         },
         "property_GenaiPrompt_mcp_deferred_tools": {
            "type": "array",
            "items": {
               "type": "string"
            }
         },
         "GenaiPrompt": {
            "type": "object",
            "properties": {
               "model_id": {
                  "type": "string"
               },
               "messages": {
                  "$ref": "#/components/schemas/property_GenaiPrompt_messages"
               },
               "temperature": {
                  "type": "number"
               },
               "max_tokens": {
                  "type": "number"
               },
               "responses": {
                  "$ref": "#/components/schemas/property_GenaiPrompt_responses"
               },
               "tokens_used": {
                  "type": "number"
               },
               "mcp_url": {
                  "type": "string"
               },
               "mcp_deferred_tools": {
                  "$ref": "#/components/schemas/property_GenaiPrompt_mcp_deferred_tools"
               },
               "mcp_authorization_token": {
                  "type": "string"
               },
               "raw": {
                  "type": "object",
                  "additionalProperties": true
               }
            }
         },
         "GenaiEmbeddingContent": {
            "type": "object",
            "properties": {
               "text": {
                  "type": "string"
               }
            },
            "required": [
               "text"
            ]
         },
         "property_GenaiEmbedding_content": {
            "type": "array",
            "items": {
               "$ref": "#/components/schemas/GenaiEmbeddingContent"
            }
         },
         "GenaiEmbedding": {
            "type": "object",
            "properties": {
               "model_id": {
                  "type": "string"
               },
               "content": {
                  "$ref": "#/components/schemas/property_GenaiEmbedding_content"
               },
               "enconding_format": {
                  "type": "string",
                  "enum": [
                     "FLOAT",
                     "UINT8",
                     "INT8",
                     "BINARY",
                     "UBINARY",
                     "BASE64"
                  ],
                  "x-speakeasy-unknown-values": "allow"
               },
               "type": {
                  "type": "string"
               },
               "dimension": {
                  "type": "number"
               },
               "max_tokens": {
                  "type": "number"
               },
               "embeddings": {
                  "type": "string"
               },
               "tokens_used": {
                  "type": "number"
               },
               "raw": {
                  "type": "object",
                  "additionalProperties": true
               },
               "id": {
                  "type": "string"
               }
            }
         }
      }
   },
   "paths": {
      "/genai/{connection_id}/model/{id}": {
         "get": {
            "summary": "Retrieve a model",
            "parameters": [
               {
                  "schema": {
                     "type": "array",
                     "items": {
                        "type": "string",
                        "enum": [
                           "id",
                           "name",
                           "description",
                           "max_tokens",
                           "web_url",
                           "has_temperature",
                           "raw"
                        ]
                     }
                  },
                  "name": "fields",
                  "in": "query",
                  "required": false,
                  "description": "Fields to return"
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "name": "raw",
                  "in": "query",
                  "required": false,
                  "description": "Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar"
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "description": "ID of the connection",
                  "name": "connection_id",
                  "in": "path",
                  "required": true
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "description": "ID of the Model",
                  "name": "id",
                  "in": "path",
                  "required": true
               }
            ],
            "tags": [
               "genai",
               "model"
            ],
            "responses": {
               "200": {
                  "content": {
                     "application/json": {
                        "schema": {
                           "$ref": "#/components/schemas/GenaiModel"
                        }
                     }
                  },
                  "description": "Successful"
               }
            },
            "security": [
               {
                  "jwt": []
               }
            ],
            "operationId": "getGenaiModel"
         }
      },
      "/genai/{connection_id}/model": {
         "get": {
            "summary": "List all models",
            "parameters": [
               {
                  "schema": {
                     "type": "number"
                  },
                  "name": "limit",
                  "in": "query",
                  "required": false
               },
               {
                  "schema": {
                     "type": "number"
                  },
                  "name": "offset",
                  "in": "query",
                  "required": false
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "name": "updated_gte",
                  "in": "query",
                  "required": false,
                  "description": "Return only results whose updated date is equal or greater to this value (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "name": "sort",
                  "in": "query",
                  "required": false
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "name": "order",
                  "in": "query",
                  "required": false
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "name": "query",
                  "in": "query",
                  "required": false,
                  "description": "Query string to search. eg. email address or name"
               },
               {
                  "schema": {
                     "type": "array",
                     "items": {
                        "type": "string",
                        "enum": [
                           "id",
                           "name",
                           "description",
                           "max_tokens",
                           "web_url",
                           "has_temperature",
                           "raw"
                        ]
                     }
                  },
                  "name": "fields",
                  "in": "query",
                  "required": false,
                  "description": "Fields to return"
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "name": "raw",
                  "in": "query",
                  "required": false,
                  "description": "Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar"
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "description": "ID of the connection",
                  "name": "connection_id",
                  "in": "path",
                  "required": true
               }
            ],
            "tags": [
               "genai",
               "model"
            ],
            "responses": {
               "200": {
                  "content": {
                     "application/json": {
                        "schema": {
                           "$ref": "#/components/schemas/GenaiModels"
                        }
                     }
                  },
                  "description": "Successful"
               }
            },
            "security": [
               {
                  "jwt": []
               }
            ],
            "operationId": "listGenaiModels"
         }
      },
      "/genai/{connection_id}/prompt": {
         "post": {
            "summary": "Create a prompt",
            "parameters": [
               {
                  "schema": {
                     "type": "array",
                     "items": {
                        "type": "string",
                        "enum": [
                           "model_id",
                           "messages",
                           "temperature",
                           "max_tokens",
                           "responses",
                           "tokens_used",
                           "mcp_url",
                           "mcp_deferred_tools",
                           "mcp_authorization_token",
                           "raw"
                        ]
                     }
                  },
                  "name": "fields",
                  "in": "query",
                  "required": false,
                  "description": "Fields to return"
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "name": "raw",
                  "in": "query",
                  "required": false,
                  "description": "Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar"
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "description": "ID of the connection",
                  "name": "connection_id",
                  "in": "path",
                  "required": true
               }
            ],
            "tags": [
               "genai",
               "prompt"
            ],
            "requestBody": {
               "required": true,
               "content": {
                  "application/json": {
                     "schema": {
                        "$ref": "#/components/schemas/GenaiPrompt"
                     }
                  }
               }
            },
            "responses": {
               "200": {
                  "content": {
                     "application/json": {
                        "schema": {
                           "$ref": "#/components/schemas/GenaiPrompt"
                        }
                     }
                  },
                  "description": "Successful"
               }
            },
            "security": [
               {
                  "jwt": []
               }
            ],
            "operationId": "createGenaiPrompt"
         }
      },
      "/genai/{connection_id}/embedding": {
         "post": {
            "summary": "Create an embedding",
            "parameters": [
               {
                  "schema": {
                     "type": "array",
                     "items": {
                        "type": "string",
                        "enum": [
                           "model_id",
                           "content",
                           "enconding_format",
                           "type",
                           "dimension",
                           "max_tokens",
                           "embeddings",
                           "tokens_used",
                           "raw",
                           "id"
                        ]
                     }
                  },
                  "name": "fields",
                  "in": "query",
                  "required": false,
                  "description": "Fields to return"
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "name": "raw",
                  "in": "query",
                  "required": false,
                  "description": "Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar"
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "description": "ID of the connection",
                  "name": "connection_id",
                  "in": "path",
                  "required": true
               }
            ],
            "tags": [
               "genai",
               "embedding"
            ],
            "requestBody": {
               "required": true,
               "content": {
                  "application/json": {
                     "schema": {
                        "$ref": "#/components/schemas/GenaiEmbedding"
                     }
                  }
               }
            },
            "responses": {
               "200": {
                  "content": {
                     "application/json": {
                        "schema": {
                           "$ref": "#/components/schemas/GenaiEmbedding"
                        }
                     }
                  },
                  "description": "Successful"
               }
            },
            "security": [
               {
                  "jwt": []
               }
            ],
            "operationId": "createGenaiEmbedding"
         }
      }
   }
}