{
  "openapi": "3.0.3",
  "info": {
    "title": "UnitedShare API",
    "version": "2026.11.09",
    "description": "Public HTTP API of United Share GmbH. Chat, embeddings, and images follow the OpenAI request shape. Send a bearer key. Health checks do not require a key."
  },
  "servers": [
    {
      "url": "https://api.unitedshare.ai",
      "description": "Production unified API"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/v1/health": {
      "get": {
        "operationId": "getV1Health",
        "summary": "API health",
        "description": "Report whether the unified API process is answering. No bearer key is required. The public host serves this check at /v1/health.",
        "responses": {
          "200": {
            "description": "Process is up.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "service"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "ok"
                      ]
                    },
                    "service": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/v1/models": {
      "get": {
        "operationId": "listModels",
        "summary": "List models",
        "description": "Return the model catalog the caller is allowed to see. An anonymous call can succeed with the public list or return 401 when the gateway requires a key.",
        "responses": {
          "200": {
            "description": "Catalog.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "object",
                    "data"
                  ],
                  "properties": {
                    "object": {
                      "type": "string",
                      "enum": [
                        "list"
                      ]
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "object",
                          "owned_by"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "object": {
                            "type": "string",
                            "enum": [
                              "model"
                            ]
                          },
                          "owned_by": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string"
                          },
                          "metered": {
                            "type": "boolean"
                          },
                          "pool": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "role": {
                            "type": "string"
                          },
                          "gate": {
                            "type": "string"
                          },
                          "stage": {
                            "type": "string"
                          },
                          "surface": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "capabilities": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "beschreibung_routing": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "description": "Failure object with message. HTTP 401 from a missing key uses the string Unauthorized in this field instead.",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/v1/account/budget": {
      "get": {
        "operationId": "getAccountBudget",
        "summary": "Read account budget",
        "description": "Read the signed-in account's monthly and daily token budget. This call does not debit the budget. Use an Authentik bearer token, not an operator limits token.",
        "responses": {
          "200": {
            "description": "Budget snapshot.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "stufe": {
                      "type": "string"
                    },
                    "erlaubt": {
                      "type": "boolean"
                    },
                    "rest_monat": {
                      "type": "integer"
                    },
                    "rest_tag": {
                      "type": "integer"
                    },
                    "nachgekauft": {
                      "type": "integer"
                    },
                    "reset_monat": {
                      "type": "integer"
                    },
                    "verbraucht_monat": {
                      "type": "integer"
                    },
                    "verbraucht_tag": {
                      "type": "integer"
                    },
                    "limit_monat": {
                      "type": "integer"
                    },
                    "limit_tag": {
                      "type": "integer"
                    },
                    "unbegrenzt": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "description": "Failure object with message. HTTP 401 from a missing key uses the string Unauthorized in this field instead.",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/projects": {
      "get": {
        "operationId": "listProjects",
        "summary": "List projects",
        "description": "Read the project queue visible to the signed-in account. Members receive an empty project list. Staff receive the connected queue.",
        "responses": {
          "200": {
            "description": "Project queue.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "connected",
                    "role",
                    "projects"
                  ],
                  "properties": {
                    "connected": {
                      "type": "boolean"
                    },
                    "role": {
                      "type": "string"
                    },
                    "projects": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "slug": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "stage": {
                            "type": "string"
                          },
                          "items": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "number": {
                                  "type": "integer"
                                },
                                "title": {
                                  "type": "string"
                                },
                                "stage": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "description": "Failure object with message. HTTP 401 from a missing key uses the string Unauthorized in this field instead.",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/projects/{slug}/steer": {
      "post": {
        "operationId": "steerProject",
        "summary": "Steer a project",
        "description": "Set or clear the repair command on one queue entry. The slug is the project id. command is repair or hold. Only a staff account may steer.",
        "responses": {
          "200": {
            "description": "Steer result.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "slug": {
                      "type": "string"
                    },
                    "number": {
                      "type": "integer"
                    },
                    "command": {
                      "type": "string"
                    },
                    "stage": {
                      "type": "string"
                    },
                    "changed": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "description": "Failure object with message. HTTP 401 from a missing key uses the string Unauthorized in this field instead.",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "description": "Failure object with message. HTTP 401 from a missing key uses the string Unauthorized in this field instead.",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "description": "Failure object with message. HTTP 401 from a missing key uses the string Unauthorized in this field instead.",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "description": "Failure object with message. HTTP 401 from a missing key uses the string Unauthorized in this field instead.",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Project slug. Lowercase letters, digits, and single hyphens.",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "number",
                  "command"
                ],
                "properties": {
                  "number": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "Queue entry number."
                  },
                  "command": {
                    "type": "string",
                    "enum": [
                      "repair",
                      "hold"
                    ],
                    "description": "repair sets the label. hold removes it."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/chat/completions": {
      "post": {
        "operationId": "createChatCompletion",
        "summary": "Create a chat completion",
        "description": "Generate a completion from a house model. Use a model id returned by listModels. stream true returns an event stream. A spent budget returns HTTP 429.",
        "responses": {
          "200": {
            "description": "Completion.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string"
                    },
                    "model": {
                      "type": "string"
                    },
                    "choices": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "index": {
                            "type": "integer"
                          },
                          "message": {
                            "type": "object",
                            "properties": {
                              "role": {
                                "type": "string"
                              },
                              "content": {
                                "type": "string"
                              }
                            }
                          },
                          "finish_reason": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "usage": {
                      "type": "object",
                      "properties": {
                        "prompt_tokens": {
                          "type": "integer"
                        },
                        "completion_tokens": {
                          "type": "integer"
                        },
                        "total_tokens": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "description": "Failure object with message. HTTP 401 from a missing key uses the string Unauthorized in this field instead.",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "description": "Failure object with message. HTTP 401 from a missing key uses the string Unauthorized in this field instead.",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "messages"
                ],
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "House model id from GET /v1/models, or auto."
                  },
                  "messages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "role",
                        "content"
                      ],
                      "properties": {
                        "role": {
                          "type": "string"
                        },
                        "content": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "stream": {
                    "type": "boolean"
                  },
                  "temperature": {
                    "type": "number"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/embeddings": {
      "post": {
        "operationId": "createEmbedding",
        "summary": "Create embeddings",
        "description": "Embed text with the house embedding model. input is a non-empty string or a list of non-empty strings. The model id for the house index is rmxos-embed2026.1.",
        "responses": {
          "200": {
            "description": "Embedding vectors.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "model": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "object": {
                            "type": "string"
                          },
                          "index": {
                            "type": "integer"
                          },
                          "embedding": {
                            "type": "array",
                            "items": {
                              "type": "number"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "description": "Failure object with message. HTTP 401 from a missing key uses the string Unauthorized in this field instead.",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "description": "Failure object with message. HTTP 401 from a missing key uses the string Unauthorized in this field instead.",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "description": "Failure object with message. HTTP 401 from a missing key uses the string Unauthorized in this field instead.",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "input"
                ],
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "input": {
                    "type": "string",
                    "description": "A non-empty string. The server also accepts a JSON array of strings."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/images/generations": {
      "post": {
        "operationId": "createImage",
        "summary": "Generate an image",
        "description": "Generate an image only when the user asked for an image. The model sent upstream is reemax-image unless the body names it. prompt must be a non-empty string.",
        "responses": {
          "200": {
            "description": "Image result.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "created": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "url": {
                            "type": "string"
                          },
                          "b64_json": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "description": "Failure object with message. HTTP 401 from a missing key uses the string Unauthorized in this field instead.",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "description": "Failure object with message. HTTP 401 from a missing key uses the string Unauthorized in this field instead.",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "description": "Failure object with message. HTTP 401 from a missing key uses the string Unauthorized in this field instead.",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "prompt"
                ],
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "Use reemax-image."
                  },
                  "prompt": {
                    "type": "string"
                  },
                  "n": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "size": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/score": {
      "post": {
        "operationId": "scoreText",
        "summary": "Score how familiar a text is",
        "description": "Score one or more texts against a model that was trained to measure perplexity, not to write. model and input are required. input is a string or a list of strings. The response lists index, score, perplexity, and verdict.",
        "responses": {
          "200": {
            "description": "Scores.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "object",
                    "model",
                    "data"
                  ],
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "model": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "index",
                          "score",
                          "verdict"
                        ],
                        "properties": {
                          "index": {
                            "type": "integer"
                          },
                          "score": {
                            "type": "number"
                          },
                          "perplexity": {
                            "type": "number",
                            "description": "Omitted when the model returns no perplexity."
                          },
                          "verdict": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "description": "Failure object with message. HTTP 401 from a missing key uses the string Unauthorized in this field instead.",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "description": "Failure object with message. HTTP 401 from a missing key uses the string Unauthorized in this field instead.",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "input"
                ],
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "input": {
                    "type": "string",
                    "description": "A string, or a JSON array of strings."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/fluent": {
      "post": {
        "operationId": "renderFluentScore",
        "summary": "Render a score as FluentScript",
        "description": "Same measurement as POST /v1/score. A success body is text/plain FluentScript, not JSON. model and input are required.",
        "responses": {
          "200": {
            "description": "FluentScript text.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "model or input is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "description": "Failure object with message. HTTP 401 from a missing key uses the string Unauthorized in this field instead.",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Bearer key missing or rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "description": "Failure object with message. HTTP 401 from a missing key uses the string Unauthorized in this field instead.",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "input"
                ],
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "input": {
                    "type": "string",
                    "description": "A string, or a JSON array of strings."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/messages": {
      "post": {
        "operationId": "createMessage",
        "summary": "Create a message",
        "description": "Anthropic-shaped message call. The gateway maps it onto the house chat path. messages is required. A spent budget returns HTTP 429.",
        "responses": {
          "200": {
            "description": "Message result.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "role": {
                      "type": "string"
                    },
                    "content": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "model": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "description": "Failure object with message. HTTP 401 from a missing key uses the string Unauthorized in this field instead.",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "description": "Failure object with message. HTTP 401 from a missing key uses the string Unauthorized in this field instead.",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "messages"
                ],
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "max_tokens": {
                    "type": "integer"
                  },
                  "messages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "role",
                        "content"
                      ],
                      "properties": {
                        "role": {
                          "type": "string"
                        },
                        "content": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Account bearer token or a device key issued to that account."
      }
    }
  }
}
