List AI providers
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/ai/providers \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/ai/providers
Example responses
200 Response
[
{
"api_keys": [
{
"created_at": "2019-08-24T14:15:22Z",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"masked": "string"
}
],
"base_url": "string",
"created_at": "2019-08-24T14:15:22Z",
"display_name": "string",
"enabled": true,
"icon": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"settings": {},
"type": "openai",
"updated_at": "2019-08-24T14:15:22Z"
}
]
Responses
Response Schema
Status Code 200
Name Type Required Restrictions Description [array item]array false » api_keysarray false »» created_atstring(date-time) false »» idstring(uuid) false »» maskedstring false » base_urlstring false » created_atstring(date-time) false » display_namestring false » enabledboolean false » iconstring false » idstring(uuid) false » namestring false » settingscodersdk.AIProviderSettings false » typecodersdk.AIProviderType false » updated_atstring(date-time) false
Enumerated Values
Property Value(s) typeanthropic, azure, bedrock, copilot, google, openai, openai-compat, openrouter, vercel
To perform this operation, you must be authenticated. Learn more .
Create an AI provider
Code samples
# Example request using curl
curl -X POST http://coder-server:8080/api/v2/ai/providers \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
POST /api/v2/ai/providers
Body parameter
{
"api_keys": [
"string"
],
"base_url": "string",
"display_name": "string",
"enabled": true,
"icon": "string",
"name": "string",
"settings": {},
"type": "openai"
}
Parameters
Example responses
201 Response
{
"api_keys": [
{
"created_at": "2019-08-24T14:15:22Z",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"masked": "string"
}
],
"base_url": "string",
"created_at": "2019-08-24T14:15:22Z",
"display_name": "string",
"enabled": true,
"icon": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"settings": {},
"type": "openai",
"updated_at": "2019-08-24T14:15:22Z"
}
Responses
To perform this operation, you must be authenticated. Learn more .
Get an AI provider
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/ai/providers/{idOrName} \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/ai/providers/{idOrName}
Parameters
Name In Type Required Description idOrNamepath string true Provider ID or name
Example responses
200 Response
{
"api_keys": [
{
"created_at": "2019-08-24T14:15:22Z",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"masked": "string"
}
],
"base_url": "string",
"created_at": "2019-08-24T14:15:22Z",
"display_name": "string",
"enabled": true,
"icon": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"settings": {},
"type": "openai",
"updated_at": "2019-08-24T14:15:22Z"
}
Responses
To perform this operation, you must be authenticated. Learn more .
Delete an AI provider
Code samples
# Example request using curl
curl -X DELETE http://coder-server:8080/api/v2/ai/providers/{idOrName} \
-H 'Coder-Session-Token: API_KEY'
DELETE /api/v2/ai/providers/{idOrName}
Parameters
Name In Type Required Description idOrNamepath string true Provider ID or name
Responses
Status Meaning Description Schema 204 No Content No Content
To perform this operation, you must be authenticated. Learn more .
Update an AI provider
Code samples
# Example request using curl
curl -X PATCH http://coder-server:8080/api/v2/ai/providers/{idOrName} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
PATCH /api/v2/ai/providers/{idOrName}
Body parameter
{
"api_keys": [
{
"api_key": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}
],
"base_url": "string",
"display_name": "string",
"enabled": true,
"icon": "string",
"settings": {}
}
Parameters
Example responses
200 Response
{
"api_keys": [
{
"created_at": "2019-08-24T14:15:22Z",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"masked": "string"
}
],
"base_url": "string",
"created_at": "2019-08-24T14:15:22Z",
"display_name": "string",
"enabled": true,
"icon": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"settings": {},
"type": "openai",
"updated_at": "2019-08-24T14:15:22Z"
}
Responses
To perform this operation, you must be authenticated. Learn more .