Revert "chore: hide AI Gateway key management UI/CLI/API (#26879)" (#26913)

Reverting
https://github.com/coder/coder/commit/377c1309b7a42ead9cfbd864f0af8e9b6e472851
since release 2.35 was already cut:
https://github.com/coder/coder/tree/release/2.35
This commit is contained in:
Paweł Banaszewski
2026-07-02 13:45:05 +00:00
committed by GitHub
parent 332e32d42b
commit 79a74fc817
15 changed files with 240 additions and 40 deletions
+146
View File
@@ -178,6 +178,152 @@ curl -X GET http://coder-server:8080/api/v2/agent-firewall/sessions/{id}/logs \
To perform this operation, you must be authenticated. [Learn more](authentication.md).
## List AI Gateway keys
### Code samples
```shell
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/ai-gateway/keys \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
```
`GET /api/v2/ai-gateway/keys`
### Example responses
> 200 Response
```json
[
{
"created_at": "2019-08-24T14:15:22Z",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"key_prefix": "string",
"last_heartbeat_at": "2019-08-24T14:15:22Z",
"name": "string"
}
]
```
### Responses
| Status | Meaning | Description | Schema |
|--------|---------------------------------------------------------|-------------|-------------------------------------------------------------------|
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.AIGatewayKey](schemas.md#codersdkaigatewaykey) |
<h3 id="list-ai-gateway-keys-responseschema">Response Schema</h3>
Status Code **200**
| Name | Type | Required | Restrictions | Description |
|-----------------------|-------------------|----------|--------------|-------------|
| `[array item]` | array | false | | |
| `» created_at` | string(date-time) | false | | |
| `» id` | string(uuid) | false | | |
| `» key_prefix` | string | false | | |
| `» last_heartbeat_at` | string(date-time) | false | | |
| `» name` | string | false | | |
To perform this operation, you must be authenticated. [Learn more](authentication.md).
## Create AI Gateway key
### Code samples
```shell
# Example request using curl
curl -X POST http://coder-server:8080/api/v2/ai-gateway/keys \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
```
`POST /api/v2/ai-gateway/keys`
> Body parameter
```json
{
"name": "string"
}
```
### Parameters
| Name | In | Type | Required | Description |
|--------|------|------------------------------------------------------------------------------------|----------|-------------------------------|
| `body` | body | [codersdk.CreateAIGatewayKeyRequest](schemas.md#codersdkcreateaigatewaykeyrequest) | true | Create AI Gateway key request |
### Example responses
> 201 Response
```json
{
"created_at": "2019-08-24T14:15:22Z",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"key": "string",
"key_prefix": "string",
"name": "string"
}
```
### Responses
| Status | Meaning | Description | Schema |
|--------|--------------------------------------------------------------|-------------|--------------------------------------------------------------------------------------|
| 201 | [Created](https://tools.ietf.org/html/rfc7231#section-6.3.2) | Created | [codersdk.CreateAIGatewayKeyResponse](schemas.md#codersdkcreateaigatewaykeyresponse) |
To perform this operation, you must be authenticated. [Learn more](authentication.md).
## Delete AI Gateway key
### Code samples
```shell
# Example request using curl
curl -X DELETE http://coder-server:8080/api/v2/ai-gateway/keys/{key} \
-H 'Coder-Session-Token: API_KEY'
```
`DELETE /api/v2/ai-gateway/keys/{key}`
### Parameters
| Name | In | Type | Required | Description |
|-------|------|--------------|----------|-------------|
| `key` | path | string(uuid) | true | Key ID |
### Responses
| Status | Meaning | Description | Schema |
|--------|-----------------------------------------------------------------|-------------|--------|
| 204 | [No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5) | No Content | |
To perform this operation, you must be authenticated. [Learn more](authentication.md).
## AI Gateway serve
### Code samples
```shell
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/ai-gateway/serve \
-H 'X-AI-Governance-Gateway-Key: API_KEY'
```
`GET /api/v2/ai-gateway/serve`
### Responses
| Status | Meaning | Description | Schema |
|--------|--------------------------------------------------------------------------|---------------------|--------|
| 101 | [Switching Protocols](https://tools.ietf.org/html/rfc7231#section-6.2.2) | Switching Protocols | |
To perform this operation, you must be authenticated. [Learn more](authentication.md).
## Get appearance
### Code samples
+1
View File
@@ -66,6 +66,7 @@ Coder — A tool for provisioning self-hosted development environments with Terr
| [<code>support</code>](./support.md) | Commands for troubleshooting issues with a Coder deployment. |
| [<code>server</code>](./server.md) | Start a Coder server |
| [<code>provisioner</code>](./provisioner.md) | View and manage provisioner daemons and jobs |
| [<code>ai-gateway</code>](./ai-gateway.md) | Manage AI Gateway |
| [<code>agent-firewall</code>](./agent-firewall.md) | Network isolation tool for monitoring and restricting HTTP/HTTPS requests |
| [<code>features</code>](./features.md) | List Enterprise features |
| [<code>licenses</code>](./licenses.md) | Add, delete, and list licenses |