This page documents the current service-first HTTP surface.
这页记录的是当前已经落地的 service-first HTTP 入口,不是未来愿景。
supported nowdocs/api/openapi.yamlpackages/surfaces/http/src/service-language.tspackages/surfaces/http/src/http-surface.tstests/integration/service-http/http-surface.integration.test.ts如果你是人来读,先看这页就够了。
如果你是 SDK、AI agent、MCP-adjacent tooling,优先读:
docs/api/openapi.yaml它像这层 HTTP surface 的“标准门牌”,让工具不用靠猜路由和字段名来摸门。
Switchyard 当前把 HTTP surface 定义为:
role = first-party-integration-entryruntimeShape = runtime-firstlocalFirst = trueconsumerCompatIncluded = false翻成人话:
这是一层给 first-party integration 用的统一运行时入口,
不是已经完成的Codex / Claude Code / OpenClawcompat façade。
GET /v1/runtime/bootstrapGET /v1/runtime/entrypoint用途:
GET /v1/runtime/providersGET /v1/runtime/byok/providersGET /v1/runtime/auth-portalGET /v1/runtime/auth-statusGET /v1/runtime/healthGET /v1/runtime/providers/{providerId}/statusGET /v1/runtime/providers/{providerId}/probeGET /v1/runtime/providers/{providerId}/remediationPOST /v1/runtime/providers/{providerId}/acquisition/startPOST /v1/runtime/providers/{providerId}/acquisition/captureGET /v1/runtime/providers/{providerId}/debug/current-pageGET /v1/runtime/providers/{providerId}/debug/current-consoleGET /v1/runtime/providers/{providerId}/debug/current-networkGET /v1/runtime/providers/{providerId}/debug/support-bundleGET /v1/runtime/providers/{providerId}/debug/workbenchdebug/workbench is a thin local-first HTML shell over the same read-only debug
truth surfaces. It is a diagnosis bench, not a control plane.
POST /v1/runtime/invokePOST /v1/runtime/byok/invokecurl http://127.0.0.1:4010/v1/runtime/providers
你应该看到:
curl http://127.0.0.1:4010/v1/runtime/invoke \
-H 'content-type: application/json' \
-d '{
"provider": "chatgpt",
"model": "gpt-4o",
"input": "Reply with exactly HELLO and nothing else.",
"lane": "web"
}'
curl http://127.0.0.1:4010/v1/runtime/byok/invoke \
-H 'content-type: application/json' \
-d '{
"provider": "gemini",
"model": "gemini-2.5-flash",
"input": "Reply with exactly HELLO and nothing else."
}'
当前最重要的错误语义是:
missing-credentialuser-action-requiredhuman-verification-requiredaccount-action-requiredpermission-gatedprovider-unavailablesession-incompleterefreshable-but-degraded生活化理解:
这套 API 不会假装“服务坏了”来掩盖“你还没登录”。 它会尽量把“钥匙没带”“门没开”“上游临时不可用”区分开。
These are not part of the current committed HTTP surface:
这些现在最多只能写成 planned 或 research,不能写成 supported.