Skip to main content

Try the API

Every operation under Specifications has a built-in Try it panel on the right side of the page. Clicking the button sends a real HTTP request from your browser to whichever gateway you have configured, renders the response inline with syntax highlighting, and copies the generated curl command to your clipboard so you can paste it into a terminal or a scratch file.

The panel covers the same workflow as a classic Swagger UI page, with two differences: the request, response, and schema renderers are native Docusaurus components (they match the rest of the site theme, including dark mode), and the target server is editable per-request without leaving the page.

Configure the target

The Data Plane spec declares a single servers[] entry with protocol, host, and port variables. The defaults are:

VariableDefault
protocolhttp
hostlocalhost
port8080

So every operation page opens with http://localhost:8080 as the default target — which matches the Quickstart Docker Compose setup. To point the panel at a different gateway, scroll to the Base URL card on the right side of any operation page and edit the three fields directly:

  • Change host to the hostname or IP of your staging or production gateway (for example gateway.acme.example.com or 10.0.3.4).
  • Change protocol to https when the gateway is behind a TLS terminator, or leave it http for a local run.
  • Change port to the port your deployment uses. Kubernetes gateways typically sit behind an ingress on 443; Docker Compose sticks with 8080.

Changes are per-tab and persist across operation navigation — switch from Chat completion to Create embeddings and your edited server values come along. Reload the page to reset to the defaults.

Paste an API key

Below the server card there is an Authentication section with a single apiKey (http, Bearer) field. Paste the plaintext gw_... value from your secret store into the field — it stays in browser memory only, is never written to disk, and is wiped on reload. See Authentication if you don't have a key yet.

The panel applies the key to the Authorization header of every request it sends from that tab. Requests to /actuator/health ignore the header, so you can verify connectivity without pasting a key first.

Send a request

  1. Fill in any required path, query, or header parameters in the Request card.
  2. Pick an example from the dropdown above the request body — the OpenAPI spec ships three presets for Chat completion (simple, streaming, and structured), and you can edit the body inline before sending.
  3. Click Send API Request (top-right of the panel).
  4. The Response card updates with the status code, headers, body, and latency. Click Copy as cURL to send yourself the generated command.

A successful chat completion round-trips in 200–1500 ms on a local gateway with a real provider key. A failed call surfaces the DVARA error envelope — same shape documented in the Overview — so you can read the error.code right out of the response card.

Limitations

The Try it panel makes the request from your browser, so it's subject to the same rules as a cross-origin fetch():

  • CORS must allow the docs origin. The Try-it panel sends a browser fetch() from the docs origin to your gateway, so the gateway (or whatever reverse proxy fronts it) has to return CORS headers permitting that origin. If the browser rejects the call with a CORS error, open a terminal and run the generated curl command instead — curl is not subject to the browser's same-origin policy.
  • Streaming responses cannot render in the panel. When you send stream: true, the panel shows the final raw SSE body after the stream completes; it does not render tokens as they arrive. Use a terminal or an SDK to exercise real streaming behavior.
  • Self-signed certificates will fail. The browser enforces TLS validation the same way it does for any fetch. If your staging gateway uses a self-signed cert, point at it with the host variable, copy the curl, and add -k to skip verification in the terminal.
  • No file uploads. The data plane currently accepts JSON only; there is no multipart/form-data endpoint, so the panel does not render a file picker.

Troubleshooting

SymptomLikely causeFix
net::ERR_CONNECTION_REFUSEDGateway is not running at the configured host+portCheck docker ps or ./mvnw spring-boot:run, verify GET /actuator/health first
401 UNAUTHORIZEDAPI key missing, wrong prefix, or revokedPaste a fresh gw_... value in the Authentication field; see Authentication
403 POLICY_DENIEDA tenant policy blocked the call (PII, guardrail, IP access, or content filter)Check the DVARA Flightdeck's Policies and Audit pages to see which rule fired
CORS preflight error in the browser consoleThe gateway's CORS config does not allow the docs originCopy the curl command and run it from a terminal, or add the docs origin to the gateway's CORS allow-list
Response hangs with no outputEither the gateway is slow or your browser is blocking the response for inspection; check the network panelRetry with the generated curl to rule out the browser