AI Assistant
Ask in plain language and the API Builder assistant builds, tests and debugs APIs for you, in any API catalog and space you have access to.
"Build an API for the orders service at https://orders.example.com/v1 with list and get-by-id, in the Payments › Core space, and test it."
"Calls to this API started failing this morning. What's wrong?"
Open it with ✨ AI Assistant on the API Builder list (it starts from the space selected there) or on an API's page (it starts from that API). It answers in the language you use Studio in.
What it can do
| Find things | List the catalogs and spaces you can use, and the APIs in them, across all your catalogs |
| Build | Write an OpenAPI spec from your description and create a draft API in the space you choose, or edit an existing draft, one operation at a time if you like. It can also build an API from an attached OpenAPI file or from a SOAP service's WSDL |
| Test | Send requests through the gateway exactly as an agent would (test console), to the working copy or any environment |
| Debug | Read test results (including the gateway's reason when it refused or failed a call), the call log, the details of failed calls from real traffic (it asks before switching them on) and gateway health, explain the problem, fix the draft and test again |
| Fix mappers | Show an operation's protocol and message mappers, run one on a sample exactly as the gateway would (without calling the upstream), and add or change them on a draft, for example a SOAP service's target namespace or root element |
| Set the gateway policy | Change a draft's gateway policy when you ask, for example "allow 650 calls a minute, 200 per user, and requests and responses up to 10 MB". Only the settings you name change; the rest keep their values |
| Explain usage | Answer questions such as "how is this API doing this week?" from its analytics: traffic, errors and latency against the previous period, the operations and error codes behind a change, and any alerts firing |
| Set up alerts | Create and change an API's alert rules, for example "tell me when more than 5% of calls fail". Alerts go to the in-app list; it adds email addresses or a webhook only when you give them |
| Say what changed | Answer "it worked yesterday, what changed?" from the API's audit log, status changes and versions, including what differs between the working copy and the latest version (operations, base URL and mappers) |
| Hand over | Fix what the spec checks report (errors stop a submit), then submit a finished draft for review |
For a large API it reads one operation at a time (its parameters, request and response schemas, and mappers) instead of the whole spec.
What stays with you
The assistant has no way to:
- approve, publish, promote or roll back an API;
- change an API that is published or in review, or its mappers (pull it back to draft first);
- create or revoke consumer keys, or view or rotate secrets;
- see or set upstream credentials — it sets the auth type and tells you to enter the secret in the form;
- delete APIs or change who has access.
It acts as you: everything goes through the same permission checks, validation and audit log as clicking the buttons yourself. If you can't create APIs in a space, neither can it.
Write calls
GET tests always run. Tests that change data on the real upstream (POST, PUT, PATCH, DELETE) only run when you tick Allow write calls under the chat box. When the assistant was refused one, its reply offers Allow write calls and continue. Every SOAP operation is a POST, so testing a SOAP service needs it too. The box starts unticked each time you open the page.
Conversations
Your conversations are saved, for you only.
- Opening the assistant brings back your latest conversation from that page: on an API's page, the one about that API; on the API Builder list, the one started there.
- History lists your saved conversations (the newest 50), with a search box once you have a few. Open one to carry on, or delete it.
- New chat starts over.
- Attached files are kept with the conversation and come back when you reopen it. Remove one with ✕.
- While a message is being answered, the conversation is busy: another tab or page shows the actions so far and waits for the answer.
- A message keeps running on the server when you close the assistant, reload the page or lose the connection. Reopen the conversation to see its progress and its answer.
Seeing what it did
While it works, each action appears as it finishes. Every reply lists the actions it took (expand "N actions"): which tool, the main arguments, whether it worked, how long it took, and the error if not. APIs it created or changed get an Open API link, and the page you're on refreshes automatically. If you have unsaved edits on that API, you're told instead, so nothing is lost.
Stop ends the current message, also from another tab or after a reload. Actions that already ran stay done, and the conversation keeps a note of them. A message that runs longer than four minutes is stopped the same way, and one cut off by a server restart says it was interrupted. Send "continue" to pick up from there: the assistant sees what it already did and doesn't redo it. It never retries on its own, so it can't create the same API twice. It doesn't repeat a call that already gave its answer, and when a test of the same path keeps failing the same way, it stops and explains instead of trying again.
A failed action shows the server's reason. For example, Unknown gateway_policy keys: [...] means a setting name was wrong; the message lists the valid names, and nothing was changed.
Requirements
- API Builder access.
- A default LLM provider and model configured for the instance — the same one mapper AI Assist uses. Without one, the assistant shows "The AI model did not answer".
Admins can give the assistant its own model of that provider under Gateway settings on the API Builder page (AI Assistant model). Choose one that calls tools reliably; leave it empty to use the provider's default model.
Each user can send 40 messages to the assistant per 10 minutes (API_BUILDER_ASSISTANT_MESSAGES_PER_10_MINUTES).
API
The panel streams each message:
POST /api/v1/api-builder/assistant/chat/stream
{
"chat_id": "…", // omit to start a new conversation
"messages": [{"role": "user", "content": "Test this API and explain any failures"}],
"context": {"api_definition_id": "…", "api_space_id": "…"},
"allow_write_tests": false,
"attachments": [{"name": "spec.yaml", "content": "…"}], // the conversation's files (kept with it)
"language": "de-DE" // optional: the language to answer in
}
→ server-sent events:
{"type": "started", "chat_id": "…"}
{"type": "action", "action": {"tool": "test_api", "args": {…}, "ok": true, "duration_ms": 142}}
{"type": "done", "reply": "…", "trace": [ … ], "touched_api_ids": [], "chat_id": "…"}
(or {"type": "error", "message": "…"} / {"type": "stopped", "trace": [ … ]})
Closing the connection only stops watching: the message carries on and its answer is saved in the conversation. POST /api/v1/api-builder/assistant/chats/{chat_id}/stop stops it. POST /api/v1/api-builder/assistant/chat takes the same body and answers once, as JSON ({"reply", "trace", "touched_api_ids", "chat_id", "pending"}). A message that takes longer than one reply allows comes back with "pending": true and its answer is saved in the conversation when it finishes.
Saved conversations:
GET /api/v1/api-builder/assistant/chats → [{"id", "title", "api_definition_id", "context", "created_at", "updated_at"}]
GET /api/v1/api-builder/assistant/chats/{chat_id} → the conversation with its messages and attached files
DELETE /api/v1/api-builder/assistant/chats/{chat_id}