2026-08-11 11:22:55 -04:00
---
# Code generated by make gen. DO NOT EDIT.
title : AI Gateway
---
<!-- DO NOT EDIT | GENERATED CONTENT -->
2025-09-26 16:20:33 +02:00
2026-06-25 16:56:37 +01:00
## List AI Gateway clients
2026-03-28 08:18:28 +11:00
### Code samples
2026-07-15 14:07:09 -04:00
```sh
2026-03-28 08:18:28 +11:00
# Example request using curl
2026-06-23 12:15:10 +01:00
curl -X GET http://coder-server:8080/api/v2/ai-gateway/clients \
2026-03-28 08:18:28 +11:00
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
```
2026-06-23 12:15:10 +01:00
`GET /api/v2/ai-gateway/clients`
Alias: also available at /api/v2/aibridge/clients for backward compatibility.
2026-03-28 08:18:28 +11:00
### Example responses
> 200 Response
```json
[
"string"
]
```
### Responses
| Status | Meaning | Description | Schema |
|--------|---------------------------------------------------------|-------------|-----------------|
| 200 | [OK ](https://tools.ietf.org/html/rfc7231#section-6.3.1 ) | OK | array of string |
2026-06-25 16:56:37 +01:00
<h3 id="list-ai-gateway-clients-responseschema">Response Schema</h3>
2026-03-28 08:18:28 +11:00
To perform this operation, you must be authenticated. [Learn more ](authentication.md ).
2026-06-25 16:56:37 +01:00
## List AI Gateway models
2026-02-26 02:40:45 +11:00
### Code samples
2026-07-15 14:07:09 -04:00
```sh
2026-02-26 02:40:45 +11:00
# Example request using curl
2026-06-23 12:15:10 +01:00
curl -X GET http://coder-server:8080/api/v2/ai-gateway/models \
2026-02-26 02:40:45 +11:00
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
```
2026-06-23 12:15:10 +01:00
`GET /api/v2/ai-gateway/models`
Alias: also available at /api/v2/aibridge/models for backward compatibility.
2026-02-26 02:40:45 +11:00
2026-09-22 14:45:18 +02:00
### Parameters
2026-11-17 11:52:12 +11:00
| Name | In | Type | Required | Description |
|---------|-------|--------|----------|----------------------------------------------------------------------------------------------------------------------------------------------|
| `q` | query | string | false | Search query in the format `key:value` . Available keys are: model. A bare term searches by model. The match is a case-insensitive substring. |
| `model` | query | string | false | Literal model identifier substring, matched case-insensitively. Cannot be combined with q. |
2026-09-22 14:45:18 +02:00
2026-02-26 02:40:45 +11:00
### Example responses
> 200 Response
```json
[
"string"
]
```
### Responses
| Status | Meaning | Description | Schema |
|--------|---------------------------------------------------------|-------------|-----------------|
| 200 | [OK ](https://tools.ietf.org/html/rfc7231#section-6.3.1 ) | OK | array of string |
2026-06-25 16:56:37 +01:00
<h3 id="list-ai-gateway-models-responseschema">Response Schema</h3>
2026-02-26 02:40:45 +11:00
To perform this operation, you must be authenticated. [Learn more ](authentication.md ).
2026-03-24 08:58:47 +02:00
2026-09-18 01:29:21 +10:00
## List AI Gateway providers
### Code samples
```sh
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/ai-gateway/providers \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
```
`GET /api/v2/ai-gateway/providers`
### Example responses
> 200 Response
```json
[
{
"display_name" : "string" ,
"icon" : "string" ,
"name" : "string" ,
"type" : "openai"
}
]
```
### Responses
| Status | Meaning | Description | Schema |
|--------|---------------------------------------------------------|-------------|---------------------------------------------------------------------------|
| 200 | [OK ](https://tools.ietf.org/html/rfc7231#section-6.3.1 ) | OK | array of [codersdk.AIBridgeProvider ](schemas.md#codersdkaibridgeprovider ) |
<h3 id="list-ai-gateway-providers-responseschema">Response Schema</h3>
Status Code **200**
| Name | Type | Required | Restrictions | Description |
|------------------|--------------------------------------------------------------|----------|--------------|-------------|
| `[array item]` | array | false | | |
| `» display_name` | string | false | | |
| `» icon` | string | false | | |
| `» name` | string | false | | |
| `» type` | [codersdk.AIProviderType ](schemas.md#codersdkaiprovidertype ) | false | | |
#### Enumerated Values
| Property | Value(s) |
|----------|---------------------------------------------------------------------------------------------------------|
| `type` | `anthropic` , `azure` , `bedrock` , `copilot` , `google` , `openai` , `openai-compat` , `openrouter` , `vercel` |
To perform this operation, you must be authenticated. [Learn more ](authentication.md ).
2026-06-25 16:56:37 +01:00
## List AI Gateway sessions
2026-03-24 08:58:47 +02:00
### Code samples
2026-07-15 14:07:09 -04:00
```sh
2026-03-24 08:58:47 +02:00
# Example request using curl
2026-06-23 12:15:10 +01:00
curl -X GET http://coder-server:8080/api/v2/ai-gateway/sessions \
2026-03-24 08:58:47 +02:00
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
```
2026-06-23 12:15:10 +01:00
`GET /api/v2/ai-gateway/sessions`
Alias: also available at /api/v2/aibridge/sessions for backward compatibility.
2026-03-24 08:58:47 +02:00
### Parameters
2026-05-25 16:31:48 +02:00
| Name | In | Type | Required | Description |
|--------------------|-------|---------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|
| `q` | query | string | false | Search query in the format `key:value` . Available keys are: initiator, provider, provider_name, model, client, session_id, started_after, started_before. |
| `limit` | query | integer | false | Page limit |
| `after_session_id` | query | string | false | Cursor pagination after session ID (cannot be used with offset) |
| `offset` | query | integer | false | Offset pagination (cannot be used with after_session_id) |
2026-03-24 08:58:47 +02:00
### Example responses
> 200 Response
```json
{
"count" : 0 ,
"sessions" : [
{
"client" : "string" ,
"ended_at" : "2019-08-24T14:15:22Z" ,
"id" : "string" ,
"initiator" : {
"avatar_url" : "http://example.com" ,
"id" : "497f6eca-6276-4993-bfeb-53cbbbba6f08" ,
"name" : "string" ,
"username" : "string"
},
2026-04-22 12:06:49 -04:00
"last_active_at" : "2019-08-24T14:15:22Z" ,
2026-03-24 08:58:47 +02:00
"last_prompt" : "string" ,
"metadata" : {
"property1" : null ,
"property2" : null
},
"models" : [
"string"
],
2026-07-21 14:34:23 +02:00
"network_calls" : {
"blocked" : 0 ,
"total" : 0
},
2026-03-24 08:58:47 +02:00
"providers" : [
"string"
],
"started_at" : "2019-08-24T14:15:22Z" ,
"threads" : 0 ,
"token_usage_summary" : {
2026-04-03 16:27:31 +02:00
"cache_read_input_tokens" : 0 ,
"cache_write_input_tokens" : 0 ,
2026-03-24 08:58:47 +02:00
"input_tokens" : 0 ,
"output_tokens" : 0
}
}
]
}
```
### Responses
| Status | Meaning | Description | Schema |
|--------|---------------------------------------------------------|-------------|------------------------------------------------------------------------------------------|
| 200 | [OK ](https://tools.ietf.org/html/rfc7231#section-6.3.1 ) | OK | [codersdk.AIBridgeListSessionsResponse ](schemas.md#codersdkaibridgelistsessionsresponse ) |
To perform this operation, you must be authenticated. [Learn more ](authentication.md ).
2026-03-26 18:09:53 +02:00
2026-06-25 16:56:37 +01:00
## Get AI Gateway session threads
2026-03-26 18:09:53 +02:00
### Code samples
2026-07-15 14:07:09 -04:00
```sh
2026-03-26 18:09:53 +02:00
# Example request using curl
2026-06-23 12:15:10 +01:00
curl -X GET http://coder-server:8080/api/v2/ai-gateway/sessions/{ session_id} \
2026-03-26 18:09:53 +02:00
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
```
2026-06-23 12:15:10 +01:00
`GET /api/v2/ai-gateway/sessions/{session_id}`
Alias: also available at /api/v2/aibridge/sessions/{session_id} for backward compatibility.
2026-03-26 18:09:53 +02:00
### Parameters
| Name | In | Type | Required | Description |
|--------------|-------|---------|----------|-----------------------------------------------------|
| `session_id` | path | string | true | Session ID (client_session_id or interception UUID) |
| `after_id` | query | string | false | Thread pagination cursor (forward/older) |
| `before_id` | query | string | false | Thread pagination cursor (backward/newer) |
| `limit` | query | integer | false | Number of threads per page (default 50) |
### Example responses
> 200 Response
```json
{
"client" : "string" ,
"ended_at" : "2019-08-24T14:15:22Z" ,
"id" : "string" ,
"initiator" : {
"avatar_url" : "http://example.com" ,
"id" : "497f6eca-6276-4993-bfeb-53cbbbba6f08" ,
"name" : "string" ,
"username" : "string"
},
"metadata" : {
"property1" : null ,
"property2" : null
},
"models" : [
"string"
],
2026-08-03 11:34:27 +02:00
"network_call_logs" : [
{
"allowed" : true ,
"captured_at" : "2019-08-24T14:15:22Z" ,
"created_at" : "2019-08-24T14:15:22Z" ,
"detail" : "string" ,
"id" : "497f6eca-6276-4993-bfeb-53cbbbba6f08" ,
"matched_rule" : "string" ,
"method" : "string" ,
"proto" : "string" ,
"sequence_number" : 0 ,
"session_id" : "1ffd059c-17ea-40a8-8aef-70fd0307db82"
}
],
2026-07-30 13:09:46 +02:00
"network_calls" : {
"blocked" : 0 ,
"total" : 0
},
"network_domain_count" : 0 ,
"network_top_domains" : [
{
"count" : 0 ,
"domain" : "string"
}
],
2026-03-26 18:09:53 +02:00
"page_ended_at" : "2019-08-24T14:15:22Z" ,
"page_started_at" : "2019-08-24T14:15:22Z" ,
"providers" : [
"string"
],
"started_at" : "2019-08-24T14:15:22Z" ,
"threads" : [
{
2026-06-22 15:17:37 +02:00
"agent_firewall_sequence_number" : 0 ,
"agent_firewall_session_id" : "3735294f-18b1-4e7a-a269-99c30f0b30e7" ,
2026-03-26 18:09:53 +02:00
"agentic_actions" : [
{
2026-09-18 15:22:02 +01:00
"attribution" : {
"property1" : "string" ,
"property2" : "string"
},
"interception_id" : "34d9b688-63ad-46f4-88b5-665c1e7f7824" ,
2026-03-26 18:09:53 +02:00
"model" : "string" ,
2026-10-26 10:01:50 +00:00
"priced_model" : {
"cache_read_price" : 0 ,
"cache_write_price" : 0 ,
"input_price" : 0 ,
"model" : "string" ,
"output_price" : 0
},
2026-03-26 18:09:53 +02:00
"thinking" : [
{
"text" : "string"
}
],
"token_usage" : {
2026-04-03 16:27:31 +02:00
"cache_read_input_tokens" : 0 ,
"cache_write_input_tokens" : 0 ,
2026-10-26 10:01:50 +00:00
"cost_micros" : 0 ,
"has_unpriced_usage" : true ,
2026-03-26 18:09:53 +02:00
"input_tokens" : 0 ,
"metadata" : {
"property1" : null ,
"property2" : null
},
"output_tokens" : 0
},
"tool_calls" : [
{
"created_at" : "2019-08-24T14:15:22Z" ,
"id" : "497f6eca-6276-4993-bfeb-53cbbbba6f08" ,
"injected" : true ,
"input" : "string" ,
"interception_id" : "34d9b688-63ad-46f4-88b5-665c1e7f7824" ,
"metadata" : {
"property1" : null ,
"property2" : null
},
"provider_response_id" : "string" ,
"server_url" : "string" ,
"tool" : "string"
}
]
}
],
2026-09-18 15:22:02 +01:00
"attribution" : {
"property1" : "string" ,
"property2" : "string"
},
2026-04-09 11:41:17 -04:00
"credential_hint" : "string" ,
"credential_kind" : "string" ,
2026-03-26 18:09:53 +02:00
"ended_at" : "2019-08-24T14:15:22Z" ,
2026-07-09 15:36:56 +02:00
"error_message" : "string" ,
"error_type" : "string" ,
2026-03-26 18:09:53 +02:00
"id" : "497f6eca-6276-4993-bfeb-53cbbbba6f08" ,
"model" : "string" ,
2026-10-26 10:01:50 +00:00
"priced_model" : {
"cache_read_price" : 0 ,
"cache_write_price" : 0 ,
"input_price" : 0 ,
"model" : "string" ,
"output_price" : 0
},
2026-03-26 18:09:53 +02:00
"prompt" : "string" ,
"provider" : "string" ,
"started_at" : "2019-08-24T14:15:22Z" ,
"token_usage" : {
2026-04-03 16:27:31 +02:00
"cache_read_input_tokens" : 0 ,
"cache_write_input_tokens" : 0 ,
2026-10-26 10:01:50 +00:00
"cost_micros" : 0 ,
"has_unpriced_usage" : true ,
2026-03-26 18:09:53 +02:00
"input_tokens" : 0 ,
"metadata" : {
"property1" : null ,
"property2" : null
},
"output_tokens" : 0
}
}
],
"token_usage_summary" : {
2026-04-03 16:27:31 +02:00
"cache_read_input_tokens" : 0 ,
"cache_write_input_tokens" : 0 ,
2026-10-26 10:01:50 +00:00
"cost_micros" : 0 ,
"has_unpriced_usage" : true ,
2026-03-26 18:09:53 +02:00
"input_tokens" : 0 ,
"metadata" : {
"property1" : null ,
"property2" : null
},
"output_tokens" : 0
}
}
```
### Responses
| Status | Meaning | Description | Schema |
|--------|---------------------------------------------------------|-------------|----------------------------------------------------------------------------------------------|
| 200 | [OK ](https://tools.ietf.org/html/rfc7231#section-6.3.1 ) | OK | [codersdk.AIBridgeSessionThreadsResponse ](schemas.md#codersdkaibridgesessionthreadsresponse ) |
To perform this operation, you must be authenticated. [Learn more ](authentication.md ).