Skip to content

Integration Guide

This guide is for developers who integrate an application with the service. It covers authentication, chatting with agents and the events your client has to handle.

All examples use placeholders in the form ${NAME}. Replace them with the values configured for your tenant and environment. You receive these values during onboarding.

The service offers two APIs:

APIUse it toTypical use
Agent RuntimeTalk to deployed agents and teamsEmbed an assistant in your application
Semantic Query EngineManage datasources, ingest documents and run semantic searchesMake your own documents available to agents. See Knowledge and Search.

Use both together when an assistant should answer based on your own data.

flowchart LR
    App[Your application] -->|chat| RT[Agent Runtime]
    App -->|ingest and search| SQE[Semantic Query Engine]
    RT -->|retrieval| SQE

The Agent Runtime offers two chat APIs:

APIWhen to use it
Chat completionsDefault. OpenAI-compatible, with or without streaming. All examples in this guide use it.
Responses APIOptional alternative. Streaming only. Delivers reasoning, tool activity and citations as separate items, for rich chat interfaces.

Download the integration skill (ZIP). It contains this complete guide, including Knowledge and Search and Security and Access, in the Agent Skills format. Unpack it into the skills folder of your coding assistant, for example .github/skills/ or .claude/skills/ in your repository. The assistant then uses the guide when you ask it to build or change an integration.

The skill is generated from this documentation on every release, so download it again to get updates.

You need the following values for your tenant:

ValueDescription
${TENANT_ID}Identifier of your tenant
${TOKEN_ENDPOINT}OAuth 2.0 token endpoint of your tenant
${RUNTIME_BASE_URL}Base URL of the Agent Runtime
${SQE_BASE_URL}Base URL of the Semantic Query Engine
${RUNTIME_AUDIENCE} and ${SQE_AUDIENCE}Target audiences for access tokens
${RUNTIME_CLIENT_ID} and secretClient for chat integration
${INGESTION_CLIENT_ID} and secretClient for ingestion and retrieval

Every authenticated request needs these headers:

HeaderValue
AuthorizationBearer ${ACCESS_TOKEN}
X-Tenant-ID${TENANT_ID}. Must match the tenant in the token.
Content-Typeapplication/json for JSON bodies

Both APIs publish an interactive API reference: ${RUNTIME_BASE_URL}/docs for the Agent Runtime and ${SQE_BASE_URL}/docs for the Semantic Query Engine.

The service uses OAuth 2.0 with tenant isolation. Each API expects a token for its own audience. All token requests are form-encoded and go to the token endpoint of your tenant:

POST ${TOKEN_ENDPOINT}
Content-Type: application/x-www-form-urlencoded

The runtime acts for a specific user, so that the user’s roles decide which agents may be used. This takes two token exchanges.

Step 1: get a token for the user.

grant_type=urn:ietf:params:oauth:grant-type:token-exchange
&subject_token_type=urn:ietf:params:oauth:token-type:access_token
&client_id=${RUNTIME_CLIENT_ID}
&client_secret=${RUNTIME_CLIENT_SECRET}
&requested_subject=${USER_ID}
&scope=openid

${USER_ID} is the username or email of the user. The response contains an access_token, referred to below as ${IMPERSONATED_TOKEN}.

Step 2: exchange it for a token for the Agent Runtime.

grant_type=urn:ietf:params:oauth:grant-type:token-exchange
&subject_token_type=urn:ietf:params:oauth:token-type:access_token
&client_id=${RUNTIME_CLIENT_ID}
&client_secret=${RUNTIME_CLIENT_SECRET}
&subject_token=${IMPERSONATED_TOKEN}
&scope=openid
&audience=${RUNTIME_AUDIENCE}

Use the returned access_token as ${RUNTIME_TOKEN}. It is valid for the time given in expires_in. Request a new token before it expires.

Ingestion and retrieval use a service client:

grant_type=client_credentials
&client_id=${INGESTION_CLIENT_ID}
&client_secret=${INGESTION_CLIENT_SECRET}
&scope=openid
&audience=${SQE_AUDIENCE}

Use the returned access_token as ${SQE_TOKEN}.

Agent Runtime

Knowledge and Search

Security and Access

General