Skip to content

Commit 0167034

Browse files
leemthompoclaudecharlotte-hoblik
authored
Document inference_id parameter for Agent Builder model routing (#7287)
Closes elastic/docs-content-internal#1255 Documents the `inference_id` / `connector_id` parameters for per-request model routing on the Agent Builder Converse API. ## Context elastic/kibana#262014 shipped a public alias for `connector_id` used for **agent model routing** on the **Converse API** and the **`ai.agent` workflow step**. ## Changes - `agent-builder/kibana-api.md`: new "Route a request to a specific model" example in **Chat and conversations**, covering `connector_id` / `inference_id`, mutual exclusivity, and default behavior. - `agent-builder/models.md`: new "Select a model for a single request" section pointing to the API. The `ai.agent` workflow step is documented separately — see **Related**. ## Details - **Source:** elastic/kibana#262014 (by @ashatova, merged 2026-04-10) - **Availability:** `stack: ga 9.4+`, `serverless: ga` - Sending both `connector_id` and `inference_id` returns `400 Bad Request`; omitting both uses the agent's default model. ## Related - Companion PR #7289 corrects the `ai.agent` workflow step docs (`agents-and-workflows.md`), including its `connector-id` / `inference-id` model routing. No file overlap between the two. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> Co-authored-by: Charlotte Hoblik <116336412+charlotte-hoblik@users.noreply.github.com>
1 parent 00e28cd commit 0167034

2 files changed

Lines changed: 58 additions & 0 deletions

File tree

explore-analyze/ai-features/agent-builder/kibana-api.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,6 +1072,48 @@ curl -X POST "${KIBANA_URL}/api/agent_builder/converse/async" \
10721072

10731073
::::
10741074

1075+
**Example:** Route a request to a specific model {applies_to}`stack: ga 9.4+`
1076+
1077+
By default, an agent uses its configured model. To override the model for a single request, pass either `connector_id` or `inference_id` in the request body:
1078+
1079+
* `inference_id` takes an [{{infer}} endpoint](models.md#add-an-inference-endpoint) ID.
1080+
* `connector_id` takes a [connector](models.md#configure-a-connector) ID.
1081+
1082+
Both parameters route the request to the same underlying model and are mutually exclusive. If you send both, the request fails with a `400` error. If you omit both, the agent uses its default model.
1083+
1084+
::::{tab-set}
1085+
:group: api-examples
1086+
1087+
:::{tab-item} Console
1088+
:sync: console
1089+
```console
1090+
POST kbn://api/agent_builder/converse
1091+
{
1092+
"input": "What is Elasticsearch?",
1093+
"agent_id": "elastic-ai-agent",
1094+
"inference_id": "my-inference-endpoint-id"
1095+
}
1096+
```
1097+
:::
1098+
1099+
:::{tab-item} curl
1100+
:sync: curl
1101+
```bash
1102+
curl -X POST "${KIBANA_URL}/api/agent_builder/converse" \
1103+
-H "Authorization: ApiKey ${API_KEY}" \
1104+
-H "kbn-xsrf: true" \
1105+
-H "Content-Type: application/json" \
1106+
-d '{
1107+
"input": "What is Elasticsearch?",
1108+
"agent_id": "elastic-ai-agent",
1109+
"inference_id": "my-inference-endpoint-id"}'
1110+
```
1111+
:::{include} _snippets/spaces-api-note.md
1112+
:::
1113+
:::
1114+
1115+
::::
1116+
10751117
**Example:** List conversations
10761118

10771119
This example uses the [list conversations API]({{kib-apis}}operation/operation-get-agent-builder-conversations).

explore-analyze/ai-features/agent-builder/models.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,22 @@ To learn more, refer to [select a different model](/explore-analyze/ai-features/
5757
:screenshot:
5858
:::
5959

60+
## Select a model for a single request
61+
62+
```{applies_to}
63+
stack: ga 9.4+
64+
serverless: ga
65+
```
66+
67+
When you call an agent through the [Converse API](kibana-api.md#chat-and-conversations), you can override the agent's configured model for that request. Pass one of the following in the request body:
68+
69+
* `inference_id`: the ID of an [{{infer}} endpoint](#add-an-inference-endpoint).
70+
* `connector_id`: the ID of a [connector](#configure-a-connector).
71+
72+
Both parameters route the request to the same underlying model and are mutually exclusive. If you send both, the request fails with a `400` error. If you omit both, the agent uses its default model.
73+
74+
For an example request, refer to [Route a request to a specific model](kibana-api.md#chat-and-conversations).
75+
6076
## Change the default model
6177

6278
::::{applies-switch}

0 commit comments

Comments
 (0)