{
  "openapi": "3.1.0",
  "info": {
    "title": "SeedRouter Claude Sonnet 5.5",
    "version": "1.0.0",
    "description": "Sonnet 5.5 Messages contract and basic OpenAI-compatible endpoints. Known compatibility gaps include zero-output cache prewarming, stop sequences, and on-demand compaction. See the companion Markdown before relying on advanced options. Failed requests are not charged."
  },
  "servers": [
    {
      "url": "https://api.seedrouter.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."
          }
        ]
      }
    },
    "/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-sonnet-5-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"
                }
              }
            }
          }
        }
      }
    },
    "/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-sonnet-5-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"
                }
              }
            }
          }
        }
      }
    }
  },
  "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 Messages request. Model-specific restrictions apply. Keeping an optional field in a request does not establish that its behavior is implemented; see the compatibility report in the Markdown documentation.",
        "properties": {
          "model": {
            "type": "string",
            "enum": [
              "claude-sonnet-5-5"
            ]
          },
          "max_tokens": {
            "type": "integer",
            "minimum": 0,
            "maximum": 128000,
            "description": "Official range 0–128000, including thinking. Zero requests cache prewarming without generation; the 2026-10-01 compatibility test returned 400 for zero. The upper value was accepted but a full-length generation was not tested."
          },
          "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"
                          }
                        }
                      }
                    }
                  ]
                },
                "output_config": {
                  "type": "object",
                  "description": "Per-message effort requires mid-conversation-output-config-2026-07-01 on a system message. An effort-only message can appear anywhere; content-bearing system groups follow the placement rules.",
                  "properties": {
                    "effort": {
                      "type": "string",
                      "enum": [
                        "low",
                        "medium",
                        "high",
                        "xhigh",
                        "max"
                      ]
                    }
                  }
                }
              }
            },
            "minItems": 1,
            "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"
                ],
                "properties": {
                  "type": {
                    "const": "adaptive"
                  },
                  "display": {
                    "type": "string",
                    "enum": [
                      "omitted",
                      "summarized"
                    ],
                    "default": "omitted"
                  },
                  "block_binding": {
                    "type": "object",
                    "description": "Official binding controls; requires thinking-binding-controls-2026-08-01.",
                    "additionalProperties": true
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "object",
                "required": [
                  "type"
                ],
                "properties": {
                  "type": {
                    "const": "between_tools"
                  }
                },
                "additionalProperties": false
              }
            ],
            "description": "Adaptive by default. between_tools accepts no fields beyond type and requires effort low, medium or high. enabled, disabled and manual budgets are unsupported."
          },
          "output_config": {
            "type": "object",
            "properties": {
              "effort": {
                "type": [
                  "string",
                  "null"
                ],
                "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"
                  }
                ]
              }
            }
          },
          "stop_sequences": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Official stopping strings. The current compatibility probe returned the matching string and following text; stopping behavior is not verified."
          },
          "stream": {
            "type": "boolean",
            "default": false
          },
          "temperature": {
            "type": [
              "number",
              "null"
            ],
            "enum": [
              1,
              null
            ],
            "description": "Only the compatibility value 1 is accepted; omit sampling controls."
          },
          "top_p": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0.99,
            "maximum": 1
          },
          "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"
                ],
                "properties": {
                  "type": {
                    "const": "auto"
                  },
                  "disable_parallel_tool_use": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "object",
                "required": [
                  "type"
                ],
                "properties": {
                  "type": {
                    "const": "none"
                  }
                },
                "additionalProperties": false
              }
            ],
            "default": {
              "type": "auto"
            },
            "description": "Forced any/tool selection is unsupported."
          },
          "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
            }
          },
          "service_tier": {
            "type": "string",
            "enum": [
              "auto",
              "standard_only"
            ],
            "default": "auto"
          },
          "inference_geo": {
            "type": [
              "string",
              "null"
            ],
            "description": "Official inference location. The test response reported not_available even when us was requested, so residency is not established."
          },
          "diagnostics": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "previous_message_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 256
                  }
                },
                "additionalProperties": true
              },
              {
                "type": "null"
              }
            ]
          },
          "top_k": {
            "type": "null",
            "description": "Any non-null value is rejected for this model."
          },
          "speed": {
            "enum": [
              "standard",
              null
            ],
            "description": "Omit or use standard/null. Sonnet 5.5 does not support fast mode."
          },
          "compaction": {
            "anyOf": [
              {
                "type": "object",
                "required": [
                  "type"
                ],
                "properties": {
                  "type": {
                    "const": "summarize"
                  }
                },
                "additionalProperties": true,
                "description": "Requires compact-2026-09-04. Do not combine with context_management, stop_sequences or output_config.format. Signed compaction output did not pass the compatibility test."
              },
              {
                "type": "null"
              }
            ]
          },
          "fallbacks": {
            "description": "Beta: requires server-side-fallback-2026-07-01. Models must be distinct and differ from the primary model. Overrides follow each selected model contract. Cannot be combined with a non-null fallback_credit_token. End-to-end execution and billing have not been verified.",
            "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": "Opaque credit from a prior refusal. Redemption requires a fallback-credit beta or server-side-fallback-2026-07-01; object form requires fallback-credit-2026-07-01. A valid credit can authorize assistant-prefill replay. Token validity and credit redemption are not verified locally. Cannot be combined with non-null fallbacks.",
            "anyOf": [
              {
                "type": "null"
              },
              {
                "type": "string"
              },
              {
                "type": "object",
                "required": [
                  "token"
                ],
                "additionalProperties": false,
                "properties": {
                  "token": {
                    "type": "string"
                  },
                  "mode": {
                    "enum": [
                      "strict",
                      "best_effort"
                    ],
                    "default": "strict"
                  }
                }
              }
            ]
          }
        },
        "allOf": [
          {
            "if": {
              "required": [
                "thinking"
              ],
              "properties": {
                "thinking": {
                  "required": [
                    "type"
                  ],
                  "properties": {
                    "type": {
                      "const": "between_tools"
                    }
                  }
                }
              }
            },
            "then": {
              "properties": {
                "output_config": {
                  "properties": {
                    "effort": {
                      "enum": [
                        "low",
                        "medium",
                        "high",
                        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"
                  }
                }
              }
            }
          }
        ]
      },
      "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"
          }
        }
      }
    }
  }
}
