Skip to content

ButterIX v1 is out: versions, multiple languages, Ask AI, and a per-site MCP server, all built in. →

Try it and proxy

Readers can send real requests right from the docs. Hosted sites forward them through a restricted proxy that gets around browser CORS limits without becoming an open proxy.

The "Try it" panel

Every endpoint's request example card has a Try it button. Clicking it opens the explorer (the URL gets ?explorer=true, so it can be shared; close it with the browser's Back button or Esc):

  • On the left you can search for and switch to other endpoints in the same API; credentials you've entered are kept.
  • The auth bar at the top shows the credentials the current endpoint needs; credentials are stored only in the reader's own browser (isolated per site) and are never sent to ButterIX.
  • The form is generated from the schema: strings and numbers are inputs, enums are dropdowns, booleans are switches, objects expand, and arrays let you add and remove items. Optional fields are collapsed under "More optional parameters", and you can load the spec's example with one click.
  • The request code updates live with the form, and you can switch languages and copy it. The languages match the request examples on the page and follow code-languages; credentials appear as dots, and copying uses the real values.
  • After sending, the status code, duration, and response size are shown; the response body is formatted, and you can switch between the body and the response headers.

In-page explorer: RunnableEndpoint

To embed a runnable request in the middle of a guide, use <RunnableEndpoint>:

<RunnableEndpoint endpoint="GET /whoami" collapsed />
PropDescription
endpointMETHOD /path; with multiple APIs, api-name::METHOD /path
exampleName of the example to prefill
collapsedCollapsed by default
defaultEnvironmentServer URL selected by default
readonlyRead-only fields

How requests are sent

Try a direct request first

The browser fetches the target API directly. If your API allows cross-origin requests (returns a suitable Access-Control-Allow-Origin), the request completes here.

Fall back to the proxy on CORS failure

Sites hosted on the ButterIX platform hand the request to the same-origin /_biti/proxy, which forwards it from the server and returns the response to the panel.

Proxy security rules

/_biti/proxy exists only for "Try it" and has the following restrictions so it can't be used as an open proxy:

RuleDescription
Host allowlistOnly forwards to servers origins declared in the site's OpenAPI spec (including operation-level and path-level servers); other addresses return 403
No private networksRequests are rejected when the target host resolves to a private, loopback, link-local, or similar address, including in the biti dev preview
Sensitive headers strippedCookie, Host, Origin, Referer, X-Forwarded-For, and similar headers are not forwarded; Set-Cookie in responses is dropped
No redirect following3xx responses are returned as-is
Size and timeoutResponse bodies up to 2 MB (the rest is truncated and marked truncated), 30-second timeout
Rate limit60 requests per minute per IP

See API try-it proxy in the API reference for the request and response format.

The proxy allowlist comes from the spec's servers. If your spec uses a placeholder like https://api.example.com for servers, readers' requests will be sent there. Use your real address, or use server variables to let readers choose an environment.

Configure CORS for your API

To let readers call your API directly from the browser without the proxy, allow the docs site's origin on your API gateway, for example:

Preflight response
Access-Control-Allow-Origin: https://docs.acme.com
Access-Control-Allow-Methods: GET, POST, PUT, PATCH, DELETE, OPTIONS
Access-Control-Allow-Headers: Authorization, Content-Type
Access-Control-Max-Age: 86400

Multiple environments

Declare multiple servers in the spec and readers can switch between them at the endpoint URL; use server variables for configurable parts:

servers:
  - url: https://api.acme.com/v1
    description: Production
  - url: https://sandbox.acme.com/v1
    description: Sandbox
  - url: "https://{region}.api.acme.com/v1"
    variables:
      region:
        default: cn-east
        enum: [cn-east, us-west]

Server variables are expanded with their default values in examples and in the proxy allowlist.