{
  "openapi": "3.1.0",
  "info": {
    "title": "SeedRouter Claude Haiku 5.5",
    "version": "1.0.0",
    "description": "Claude Haiku 5.5 native Messages and OpenAI-compatible endpoints. Adaptive or disabled thinking, default medium effort, forced tools, prompt caching and optional beta context management. See the Markdown reference for verified behavior and limits."
  },
  "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-haiku-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-haiku-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": "Claude Haiku 5.5 native Messages. Unknown and unsupported sampling fields are discarded before forwarding. Optional beta features require their documented anthropic-beta header.",
        "properties": {
          "model": {
            "type": "string",
            "const": "claude-haiku-5-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"
                          }
                        }
                      }
                    }
                  ]
                },
                "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"
                      ]
                    }
                  }
                },
                "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": 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"
                ],
                "additionalProperties": false,
                "properties": {
                  "type": {
                    "const": "adaptive"
                  },
                  "display": {
                    "enum": [
                      "omitted",
                      "summarized",
                      "updates",
                      null
                    ],
                    "default": "omitted",
                    "description": "updates requires thinking-display-updates-2026-08-18; progress output is not established for this model."
                  },
                  "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."
                  }
                }
              },
              {
                "type": "object",
                "required": [
                  "type"
                ],
                "additionalProperties": false,
                "properties": {
                  "type": {
                    "const": "disabled"
                  }
                }
              }
            ]
          },
          "output_config": {
            "type": "object",
            "properties": {
              "effort": {
                "enum": [
                  "low",
                  "medium",
                  "high",
                  "xhigh",
                  "max",
                  null
                ],
                "default": "medium"
              },
              "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"
                        ]
                      }
                    }
                  }
                ],
                "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
          },
          "temperature": {
            "description": "Ignored under the text-model parameter policy. Official compatibility value: 1; omit this field."
          },
          "top_p": {
            "description": "Ignored under the text-model parameter policy. Official compatibility value: 0.99; omit this field."
          },
          "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"
              }
            ]
          },
          "top_k": {
            "description": "Unsupported by Haiku 5.5 and discarded before forwarding."
          },
          "speed": {
            "enum": [
              "standard",
              null
            ],
            "description": "Fast mode is not supported."
          },
          "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": {
            "enum": [
              "default",
              null
            ],
            "description": "default requires server-side-fallback-2026-07-01. Haiku has no fallback models: a refusal stays a refusal. Explicit fallback lists are invalid."
          },
          "fallback_credit_token": {
            "description": "Official credit-token shape only; Haiku 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"
                  }
                }
              }
            ]
          }
        },
        "allOf": [
          {
            "if": {
              "required": [
                "thinking"
              ],
              "properties": {
                "thinking": {
                  "required": [
                    "type"
                  ],
                  "properties": {
                    "type": {
                      "const": "disabled"
                    }
                  }
                }
              }
            },
            "then": {
              "properties": {
                "output_config": {
                  "properties": {
                    "effort": {
                      "enum": [
                        "low",
                        "medium",
                        "high",
                        null
                      ]
                    }
                  }
                }
              }
            }
          },
          {
            "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"
                      ]
                    }
                  }
                }
              }
            }
          },
          {
            "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"
          }
        }
      }
    }
  }
}
