{
  "openapi": "3.1.0",
  "info": {
    "title": "TokLab Claude Mythos 5",
    "version": "1.0.0",
    "description": "The official Anthropic Messages API under the TokLab base URL: change the base URL and API key. The same model also answers the OpenAI Chat Completions and Responses formats. Failed requests are not charged."
  },
  "servers": [
    {
      "url": "https://api.toklab.ai/v1"
    }
  ],
  "security": [
    {
      "apiKeyHeader": []
    },
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/messages": {
      "post": {
        "summary": "Create a message (Anthropic Messages API)",
        "operationId": "createMessage",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessagesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The message, or a server-sent event stream when stream is true.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Public error in the Anthropic shape.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "const": "error"
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "invalid_api_key",
                            "permission_denied",
                            "invalid_request_error",
                            "insufficient_quota",
                            "model_not_found",
                            "task_not_found",
                            "content_policy_violation",
                            "generation_failed",
                            "no_output",
                            "delivery_failed",
                            "service_unavailable",
                            "rate_limited",
                            "submission_unknown",
                            "task_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Public error in the Anthropic shape.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "const": "error"
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "invalid_api_key",
                            "permission_denied",
                            "invalid_request_error",
                            "insufficient_quota",
                            "model_not_found",
                            "task_not_found",
                            "content_policy_violation",
                            "generation_failed",
                            "no_output",
                            "delivery_failed",
                            "service_unavailable",
                            "rate_limited",
                            "submission_unknown",
                            "task_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Public error in the Anthropic shape.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "const": "error"
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "invalid_api_key",
                            "permission_denied",
                            "invalid_request_error",
                            "insufficient_quota",
                            "model_not_found",
                            "task_not_found",
                            "content_policy_violation",
                            "generation_failed",
                            "no_output",
                            "delivery_failed",
                            "service_unavailable",
                            "rate_limited",
                            "submission_unknown",
                            "task_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Public error in the Anthropic shape.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "const": "error"
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "invalid_api_key",
                            "permission_denied",
                            "invalid_request_error",
                            "insufficient_quota",
                            "model_not_found",
                            "task_not_found",
                            "content_policy_violation",
                            "generation_failed",
                            "no_output",
                            "delivery_failed",
                            "service_unavailable",
                            "rate_limited",
                            "submission_unknown",
                            "task_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Public error in the Anthropic shape.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "const": "error"
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "invalid_api_key",
                            "permission_denied",
                            "invalid_request_error",
                            "insufficient_quota",
                            "model_not_found",
                            "task_not_found",
                            "content_policy_violation",
                            "generation_failed",
                            "no_output",
                            "delivery_failed",
                            "service_unavailable",
                            "rate_limited",
                            "submission_unknown",
                            "task_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "in": "header",
            "name": "anthropic-version",
            "required": true,
            "schema": {
              "type": "string",
              "default": "2023-06-01"
            }
          },
          {
            "in": "header",
            "name": "anthropic-beta",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated beta identifiers required by the selected official features."
          },
          {
            "name": "X-SeedRouter-Group",
            "in": "header",
            "required": false,
            "description": "Optional LLM group. Sign in to https://seedrouter.ai/models/claude-mythos-5#playground to check the groups available to your account; Playground uses your login session and requires no API key. Send the exact group name, keeping your existing model ID and API key. Omit this header or use auto to keep the key's default behavior. Restricted keys may have fewer options; use GET /api/seedrouter/llm/groups?model=MODEL_ID to check a particular key. The selected group's pricing applies; requests do not switch to another group. HTTP/SSE only, not WebSocket, image or video calls.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "default": "auto"
            }
          }
        ]
      }
    },
    "/chat/completions": {
      "post": {
        "summary": "Create a chat completion (OpenAI Chat Completions format)",
        "operationId": "createChatCompletion",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["model"],
                "additionalProperties": true,
                "description": "The OpenAI Chat Completions body; converted to this model.",
                "properties": {
                  "model": {
                    "type": "string",
                    "enum": ["claude-mythos-5"]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A chat completion, or a stream."
          },
          "400": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "X-SeedRouter-Group",
            "in": "header",
            "required": false,
            "description": "Optional LLM group. Sign in to https://seedrouter.ai/models/claude-mythos-5#playground to check the groups available to your account; Playground uses your login session and requires no API key. Send the exact group name, keeping your existing model ID and API key. Omit this header or use auto to keep the key's default behavior. Restricted keys may have fewer options; use GET /api/seedrouter/llm/groups?model=MODEL_ID to check a particular key. The selected group's pricing applies; requests do not switch to another group. HTTP/SSE only, not WebSocket, image or video calls.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "default": "auto"
            }
          }
        ]
      }
    },
    "/responses": {
      "post": {
        "summary": "Create a response (OpenAI Responses format)",
        "operationId": "createResponse",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["model"],
                "additionalProperties": true,
                "description": "The OpenAI Responses body; converted to this model.",
                "properties": {
                  "model": {
                    "type": "string",
                    "enum": ["claude-mythos-5"]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A response object, or a stream."
          },
          "400": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "X-SeedRouter-Group",
            "in": "header",
            "required": false,
            "description": "Optional LLM group. Sign in to https://seedrouter.ai/models/claude-mythos-5#playground to check the groups available to your account; Playground uses your login session and requires no API key. Send the exact group name, keeping your existing model ID and API key. Omit this header or use auto to keep the key's default behavior. Restricted keys may have fewer options; use GET /api/seedrouter/llm/groups?model=MODEL_ID to check a particular key. The selected group's pricing applies; requests do not switch to another group. HTTP/SSE only, not WebSocket, image or video calls.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "default": "auto"
            }
          }
        ]
      }
    },
    "/api/seedrouter/llm/groups": {
      "get": {
        "summary": "List available LLM groups",
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          }
        ],
        "description": "Read-only. Returns groups allowed by this API key and account with an enabled channel for the requested model. Availability is checked again at generation time. No model generation is performed.",
        "parameters": [
          {
            "name": "model",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Available groups; auto preserves the API key default.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["model", "data"],
                  "properties": {
                    "model": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": ["id", "ratio"],
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Exact value for X-SeedRouter-Group."
                          },
                          "ratio": {
                            "type": ["number", "null"],
                            "minimum": 0,
                            "description": "Account-specific group price multiplier. For auto, a current default estimate; null if unavailable."
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid LLM model."
          },
          "401": {
            "description": "Invalid API key."
          },
          "403": {
            "description": "API key or account permissions do not allow this request."
          },
          "503": {
            "description": "Group discovery is temporarily unavailable."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      },
      "apiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      }
    },
    "schemas": {
      "MessagesRequest": {
        "type": "object",
        "required": ["model", "max_tokens", "messages"],
        "additionalProperties": true,
        "description": "Native Anthropic Messages contract. Unsupported sampling and unknown fields are ignored; beta features require their documented header. See the Markdown reference for verification limits.",
        "properties": {
          "model": {
            "type": "string",
            "const": "claude-mythos-5"
          },
          "max_tokens": {
            "type": "integer",
            "minimum": 0,
            "maximum": 128000,
            "description": "Required output budget, including thinking. Zero prewarms the cache; it cannot accompany stream true, structured output or forced tools."
          },
          "messages": {
            "type": "array",
            "items": {
              "type": "object",
              "required": ["role", "content"],
              "properties": {
                "role": {
                  "type": "string",
                  "enum": ["user", "assistant", "system"]
                },
                "content": {
                  "oneOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": ["type"],
                        "additionalProperties": true,
                        "description": "A content block: text, image, document, tool_use, tool_result, thinking and the other official block types.",
                        "properties": {
                          "type": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  ]
                },
                "clear_at": {
                  "enum": ["never", "next_user_message", null],
                  "description": "System messages only; requires mid-conversation-system-clear-at-2026-08-21. next_user_message allows text only, without output_config or block caching."
                }
              }
            },
            "minItems": 0,
            "maxItems": 100000,
            "description": "Conversation messages, including mid-conversation system messages under the official placement rules. Per-message effort requires mid-conversation-output-config-2026-07-01 on a system message; an effort-only message may appear anywhere."
          },
          "system": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": ["type", "text"],
                  "properties": {
                    "type": {
                      "const": "text"
                    },
                    "text": {
                      "type": "string"
                    },
                    "cache_control": {
                      "$ref": "#/components/schemas/CacheControl"
                    }
                  },
                  "additionalProperties": true
                }
              }
            ]
          },
          "thinking": {
            "default": {
              "type": "adaptive"
            },
            "oneOf": [
              {
                "type": "object",
                "required": ["type"],
                "additionalProperties": false,
                "properties": {
                  "type": {
                    "const": "adaptive"
                  },
                  "display": {
                    "enum": ["omitted", "summarized", "updates", null],
                    "default": "omitted",
                    "description": "updates requires thinking-display-updates-2026-08-18."
                  },
                  "block_binding": {
                    "oneOf": [
                      {
                        "type": "null"
                      },
                      {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "prefix_mismatch_behavior": {
                            "enum": ["error", "drop_block", null]
                          }
                        }
                      }
                    ],
                    "description": "Requires thinking-binding-controls-2026-08-01."
                  }
                }
              }
            ]
          },
          "output_config": {
            "type": "object",
            "properties": {
              "effort": {
                "enum": ["low", "medium", "high", "xhigh", "max", null],
                "default": "high"
              },
              "format": {
                "oneOf": [
                  {
                    "type": "object",
                    "required": ["type", "schema"],
                    "properties": {
                      "type": {
                        "const": "json_schema"
                      },
                      "schema": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "task_budget": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "type": "object",
                    "required": ["type", "total"],
                    "properties": {
                      "type": {
                        "const": "tokens"
                      },
                      "total": {
                        "type": "integer",
                        "minimum": 20000
                      },
                      "remaining": {
                        "type": ["integer", "null"],
                        "minimum": 0
                      }
                    }
                  }
                ],
                "description": "Requires task-budgets-2026-03-13. remaining cannot accompany compaction or signed compaction history."
              }
            }
          },
          "stop_sequences": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "stream": {
            "type": "boolean",
            "default": false
          },
          "tools": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            },
            "description": "Official client/server tool definitions. Client tool name and input_schema are required. Native computer use requires computer_toolset_20260801. An accepted declaration does not verify server-tool execution."
          },
          "tool_choice": {
            "oneOf": [
              {
                "type": "object",
                "required": ["type"],
                "additionalProperties": false,
                "properties": {
                  "type": {
                    "enum": ["auto", "any"]
                  },
                  "disable_parallel_tool_use": {
                    "type": "boolean",
                    "default": false
                  }
                }
              },
              {
                "type": "object",
                "required": ["type", "name"],
                "additionalProperties": false,
                "properties": {
                  "type": {
                    "const": "tool"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "disable_parallel_tool_use": {
                    "type": "boolean",
                    "default": false
                  }
                }
              },
              {
                "type": "object",
                "required": ["type"],
                "additionalProperties": false,
                "properties": {
                  "type": {
                    "const": "none"
                  }
                }
              }
            ],
            "description": "any/tool require declared tools; named tool must exist. Forced tools suppress thinking and cannot accompany zero output budget or compaction."
          },
          "metadata": {
            "type": "object",
            "properties": {
              "user_id": {
                "type": ["string", "null"],
                "maxLength": 512
              }
            }
          },
          "cache_control": {
            "$ref": "#/components/schemas/CacheControl"
          },
          "container": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": ["string", "null"]
                  },
                  "skills": {
                    "type": ["array", "null"],
                    "maxItems": 20,
                    "items": {
                      "type": "object",
                      "required": ["type", "skill_id"],
                      "properties": {
                        "type": {
                          "enum": ["anthropic", "custom"]
                        },
                        "skill_id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64
                        },
                        "version": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64
                        }
                      },
                      "additionalProperties": true
                    }
                  }
                },
                "additionalProperties": true
              }
            ]
          },
          "context_management": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": true
              },
              {
                "type": "null"
              }
            ]
          },
          "mcp_servers": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            },
            "maxItems": 20,
            "description": "Requires the MCP beta header, including an empty array."
          },
          "service_tier": {
            "type": "string",
            "enum": ["auto", "standard_only"],
            "default": "auto"
          },
          "inference_geo": {
            "enum": ["global", "us", null]
          },
          "diagnostics": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "previous_message_id": {
                    "type": ["string", "null"],
                    "maxLength": 256
                  }
                },
                "additionalProperties": true
              },
              {
                "type": "null"
              }
            ]
          },
          "speed": {
            "enum": ["standard", null]
          },
          "compaction": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "required": ["type"],
                "properties": {
                  "type": {
                    "const": "summarize"
                  },
                  "instructions": {
                    "type": ["string", "null"],
                    "maxLength": 16384
                  }
                }
              }
            ],
            "description": "Requires compact-2026-09-04. Cannot accompany context_management, stop_sequences, output_config.format, forced tools or task_budget.remaining."
          },
          "fallbacks": {
            "description": "Official beta required. Targets depend on model/account capabilities.",
            "anyOf": [
              {
                "type": "null"
              },
              {
                "const": "default"
              },
              {
                "type": "array",
                "maxItems": 3,
                "items": {
                  "type": "object",
                  "required": ["model"],
                  "additionalProperties": false,
                  "properties": {
                    "model": {
                      "type": "string"
                    },
                    "max_tokens": {
                      "type": ["integer", "null"],
                      "minimum": 0
                    },
                    "thinking": {
                      "anyOf": [
                        {
                          "type": "null"
                        },
                        {
                          "type": "object",
                          "required": ["type"],
                          "properties": {
                            "type": {
                              "enum": [
                                "adaptive",
                                "enabled",
                                "disabled",
                                "between_tools"
                              ]
                            },
                            "budget_tokens": {
                              "type": "integer",
                              "minimum": 1024
                            },
                            "display": {
                              "enum": ["omitted", "summarized"]
                            },
                            "block_binding": {
                              "type": "object",
                              "additionalProperties": true
                            }
                          },
                          "description": "Use the selected fallback model thinking contract; between_tools allows only type, and enabled requires budget_tokens."
                        }
                      ]
                    },
                    "output_config": {
                      "anyOf": [
                        {
                          "type": "null"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "effort": {
                              "type": ["string", "null"],
                              "enum": [
                                "low",
                                "medium",
                                "high",
                                "xhigh",
                                "max",
                                null
                              ]
                            },
                            "format": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "required": ["type", "schema"],
                                  "properties": {
                                    "type": {
                                      "const": "json_schema"
                                    },
                                    "schema": {
                                      "type": "object",
                                      "additionalProperties": true
                                    }
                                  }
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          }
                        }
                      ]
                    },
                    "speed": {
                      "enum": ["standard", "fast", null]
                    }
                  }
                }
              }
            ]
          },
          "fallback_credit_token": {
            "description": "Official credit-token shape. Eligibility and token validity are checked by the API. Requires the corresponding fallback-credit beta; cannot accompany fallbacks.",
            "anyOf": [
              {
                "type": "null"
              },
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048
              },
              {
                "type": "object",
                "required": ["token"],
                "additionalProperties": false,
                "properties": {
                  "token": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2048
                  },
                  "mode": {
                    "enum": ["strict", "best_effort"],
                    "default": "strict"
                  }
                }
              }
            ]
          },
          "output_format": {
            "oneOf": [
              {
                "type": "object",
                "required": ["type", "schema"],
                "properties": {
                  "type": {
                    "const": "json_schema"
                  },
                  "schema": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Deprecated official alias; prefer output_config.format."
          },
          "thread": {
            "description": "Requires message-threads-2026-08-12. Continuation omits system/tools. Incompatible with compaction or context edits except keeping all thinking.",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "required": ["type"],
                "additionalProperties": false,
                "properties": {
                  "type": {
                    "const": "create"
                  }
                }
              },
              {
                "type": "object",
                "required": ["type", "previous_message_id"],
                "additionalProperties": false,
                "properties": {
                  "type": {
                    "const": "continue"
                  },
                  "previous_message_id": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              }
            ]
          }
        },
        "allOf": [
          {
            "if": {
              "required": ["max_tokens"],
              "properties": {
                "max_tokens": {
                  "const": 0
                }
              }
            },
            "then": {
              "properties": {
                "stream": {
                  "const": false
                },
                "output_config": {
                  "properties": {
                    "format": {
                      "type": "null"
                    }
                  }
                },
                "tool_choice": {
                  "properties": {
                    "type": {
                      "enum": ["auto", "none"]
                    }
                  }
                },
                "output_format": {
                  "type": "null"
                }
              }
            }
          },
          {
            "if": {
              "required": ["compaction"],
              "properties": {
                "compaction": {
                  "not": {
                    "type": "null"
                  }
                }
              }
            },
            "then": {
              "not": {
                "anyOf": [
                  {
                    "required": ["context_management"],
                    "properties": {
                      "context_management": {
                        "not": {
                          "type": "null"
                        }
                      }
                    }
                  },
                  {
                    "required": ["stop_sequences"],
                    "properties": {
                      "stop_sequences": {
                        "minItems": 1
                      }
                    }
                  }
                ]
              },
              "properties": {
                "output_config": {
                  "not": {
                    "required": ["format"],
                    "properties": {
                      "format": {
                        "not": {
                          "type": "null"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          {
            "not": {
              "required": ["fallbacks", "fallback_credit_token"],
              "properties": {
                "fallbacks": {
                  "not": {
                    "type": "null"
                  }
                },
                "fallback_credit_token": {
                  "not": {
                    "type": "null"
                  }
                }
              }
            }
          },
          {
            "if": {
              "required": ["thread"],
              "properties": {
                "thread": {
                  "type": "object",
                  "required": ["type"],
                  "properties": {
                    "type": {
                      "const": "continue"
                    }
                  }
                }
              }
            },
            "else": {
              "properties": {
                "messages": {
                  "minItems": 1
                }
              }
            }
          }
        ]
      },
      "Message": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "const": "message"
          },
          "role": {
            "const": "assistant"
          },
          "model": {
            "type": "string"
          },
          "content": {
            "type": "array",
            "items": {
              "type": "object",
              "required": ["type"],
              "additionalProperties": true,
              "description": "A content block: text, image, document, tool_use, tool_result, thinking and the other official block types.",
              "properties": {
                "type": {
                  "type": "string"
                }
              }
            }
          },
          "stop_reason": {
            "type": ["string", "null"]
          },
          "stop_sequence": {
            "type": ["string", "null"]
          },
          "usage": {
            "type": "object",
            "properties": {
              "input_tokens": {
                "type": "integer"
              },
              "output_tokens": {
                "type": "integer"
              },
              "cache_read_input_tokens": {
                "type": "integer"
              },
              "cache_creation_input_tokens": {
                "type": "integer"
              },
              "cache_creation": {
                "type": "object",
                "properties": {
                  "ephemeral_5m_input_tokens": {
                    "type": "integer"
                  },
                  "ephemeral_1h_input_tokens": {
                    "type": "integer"
                  }
                }
              },
              "inference_geo": {
                "type": "string"
              },
              "service_tier": {
                "type": "string"
              },
              "output_tokens_details": {
                "type": "object",
                "properties": {
                  "thinking_tokens": {
                    "type": "integer",
                    "minimum": 0
                  }
                }
              },
              "server_tool_use": {
                "type": "object",
                "additionalProperties": true
              },
              "iterations": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true
                }
              },
              "fallback_credit": {
                "type": ["object", "null"],
                "additionalProperties": true
              }
            }
          },
          "container": {
            "type": ["object", "null"],
            "additionalProperties": true
          },
          "diagnostics": {
            "type": ["object", "null"],
            "additionalProperties": true
          },
          "context_management": {
            "type": ["object", "null"],
            "additionalProperties": true
          },
          "stop_details": {
            "type": ["object", "null"],
            "additionalProperties": true
          },
          "input_transformations": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        }
      },
      "Error": {
        "type": "object",
        "required": ["code", "message"],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              10001, 10002, 20001, 20002, 30001, 30002, 50001, 50002, 50003,
              60001, 60002, 60003, 60004, 90001
            ]
          },
          "message": {
            "type": "string"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    }
  }
}
