Skip to content
FousDocs
Open Studio

Migrate from the old API

Every change from the old API, with each old call next to its new one, and a prompt that moves your code for you.

Your API keys, the base URL and the MCP server stay the same. What the old API called tools are now methods: each operation is one method, named by its site's domain and the operation, such as markets.example.com/get_company_size. Every method belongs to one organization: yours, and the shared ones your organization has run, are now your organization's methods.

POST /v1/query, GET /v1/query/requests/{request_id} and POST /v1/query/cancel keep working until 11 November 2026. Every other old endpoint has stopped.

Run a method

- POST /v1/query
+ POST /v1/runs
  Idempotency-Key: 6a1f0c2e
  {
-   "api": "@markets",
-   "operation": "get_company_size",
+   "method": "markets.example.com/get_company_size",
    "input": { "company": "Example Inc" }
  }
  {
-   "success": true,
-   "data": {
-     "output": { "ticker": "EXMP", "market_cap_usd": 404720000000 },
-     "receipt": {
-       "request_id": "req_run_01m69eaghdfsdrysprnyfwr8xy",
-       "billing": { "charged_credits": 1 }
-     }
-   }
+   "id": "run_01m69eaghdfsdrysprnyfwr8xy",
+   "status": "completed",
+   "data": { "ticker": "EXMP", "market_cap_usd": 404720000000 },
+   "credits": 1,
+   "duration_ms": 1693
  }
  • "version": 2 is now "method": "markets.example.com/get_company_size@2".
  • visibility, stream and response are gone. Take the fields you need from data.
  • To find a slug, GET /v1/methods?site=markets.example.com lists the site's methods, and every old-format response names its method in data.receipt.method.

Slow runs

The old call waited up to 170 seconds. POST /v1/runs waits wait seconds (0 to 60, 30 by default), then returns 202 with "status": "running" and the run's id:

- GET  /v1/query/requests/req_run_01m69eaghdfsdrysprnyfwr8xy
+ GET  /v1/runs/run_01m69eaghdfsdrysprnyfwr8xy?wait=30
- POST /v1/query/cancel  {"idempotency_key": "6a1f0c2e"}
+ POST /v1/runs/run_01m69eaghdfsdrysprnyfwr8xy/cancel

Errors

  {
-   "success": false,
    "error": {
-     "type": "authentication_error",
-     "code": "revoked_api_key",
-     "status": 401,
-     "retryable": false,
+     "code": "unauthorized",
+     "reason": "revoked_api_key",
      "message": "API key has been revoked.",
+     "next_step": "Send Authorization: Bearer <key>. Create a key in Fous Studio: …"
    }
  }

Branch on the HTTP status and error.code. The codes that changed:

invalid_api_key, expired_api_key, revoked_api_key  → unauthorized (401)
insufficient_balance                               → insufficient_credits (402)
spend_limit_exceeded, monthly_spend_limit_exceeded → insufficient_credits (402)
rate_limit_exceeded, organization_rate_limit,
  organization_concurrency_limit                   → rate_limited (429)
unknown_api_slug, unknown_operation                → not_found (404)
auth_required, credentials_missing                 → connection_required
source_blocked                                     → upstream_blocked (503)
source_rate_limited, upstream_http_error           → upstream_error (503)
execution_timeout                                  → upstream_timeout (503)
internal_error                                     → server_error (500)
invalid_input (400)                                → invalid_input (422)

Where the old code was more specific, error.reason keeps it, such as revoked_api_key, spend_limit or site_rate_limited.

Every code is in Errors.

Find methods

- GET /v1/catalog?query=example+inc+market+cap
+ GET /v1/methods?query=example+inc+market+cap
- GET /v1/catalog/detail?api=@markets
+ GET /v1/methods?site=markets.example.com
+ GET /v1/methods/markets.example.com/get_company_size

Search covers your organization's methods. The old data.items, each a tool with its operations, is now methods, one method each, with its slug, effect and input_schema. /v1/catalog/suggest, /v1/catalog/categories, /v1/catalog/sitemap and /v1/catalog/tools are gone.

Your methods

- GET    /v1/tools
+ GET    /v1/methods
- GET    /v1/tools/@example
+ GET    /v1/methods/example.com/list_invoices
- DELETE /v1/tools/@example/methods/{method_id}
+ DELETE /v1/methods/example.com/list_invoices
- PUT    /v1/catalog/version-preference  {"operation_id": 1820}
+ PATCH  /v1/methods/markets.example.com/get_company_size  {"current_version": 2}

DELETE /v1/tools/{api} deleted every operation of a tool; delete each method now. /restore and /environment are gone.

Builds

  POST /v1/builds
  {
-   "prompt": "List my invoices on example.com",
-   "url": "https://example.com/billing",
+   "prompt": "List my invoices on example.com",
+   "site": "example.com",
-   "visibility": "private",
-   "connections": { "billing": "conn_01m5kvvt1pkybmt03dyvhyd5m2" },
-   "environment": { "EXAMPLE_API_KEY": "sk_live_…" }
+   "connections": ["conn_01m5kvvt1pkybmt03dyvhyd5m2"]
  }
  • visibility is gone: every method is your organization's own.
  • api or method_id, to change a method, is now method. A key in environment becomes an api_key connection (below). contribute and risk_acknowledgment are gone.
  • /approvals/{approval_id} is gone: a build that writes does its action once, for real, with the input you send. /retry is gone: send POST /v1/builds/{id}/messages with {"prompt": "…"} while it runs, or start a new build.

Connections

- POST   /v1/connections/attempts {"website_url": "https://example.com"}
+ POST   /v1/connections {"site": "example.com", "type": "session"}
- GET    /v1/connections/attempts/{attempt_id}
+ GET    /v1/connections/{id}
- POST   /v1/connections/attempts/{attempt_id}/submit {"step_id": "…", "fields": {…}}
+ POST   /v1/connections/{id}/sign-in {"step_id": "…", "fields": {…}}
- POST   /v1/connections/attempts/{attempt_id}/retry
+ POST   /v1/connections/{id}/sign-in {"restart": true}
- POST   /v1/connections/attempts/{attempt_id}/cancel
+ DELETE /v1/connections/{id}/sign-in

A saved key is a connection too:

- PUT  /v1/variables
- {"site": "example.com", "name": "API_KEY", "value": "sk_live_…"}
+ POST /v1/connections
+ {"site": "example.com", "type": "api_key", "api_key": "sk_live_…"}

consent is no longer sent. challenge_id and /confirm are gone: a connection turns active when its sign-in ends. GET /v1/connections lists sign-ins and keys alike.

Account

- GET /v1/auth
- GET /v1/usage
+ GET /v1/account

/v1/account has the organization, credits left (credits.balance), plan limits and the key; spending history is in Studio. Rating a call (/feedback) is gone.

MCP tools

The server address is the same, and clients load the new tools when they reconnect. Update prompts or code that name the old ones:

fous_search_tools                      → search
fous_run_tool                          → run
fous_run_action                        → run_action
fous_get_run, fous_get_build           → get_run
fous_get_tool, fous_delete_tool        → methods
fous_build_tool                        → build
fous_connect_account, fous_variables   → connections (action "connect")
fous_connections                       → connections
fous_status                            → account

New: stop, builds and workflows.

Until the sunset

The three old /v1/query endpoints return the old response format, run on the new system and cost the same 1 credit. Each response carries Deprecation, Sunset (when they stop) and Link (this guide). Until then:

  • request_id is the run's id with req_ in front.
  • data.receipt.method is the method to send POST /v1/runs.
  • response.format text or markdown, response.schema and response.mapping return 400; include and exclude still work.
  • A stream sends the accepted stage, then the result.

From 11 November 2026, 00:00 UTC (the Sunset date), they return 410. Questions: hello@fous.com.