> For the complete documentation index, see [llms.txt](https://docs.sigrex.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sigrex.io/api-reference/reference/api-keys/llm-api-keys.md).

# LLM API Keys

## GET /api/v2/api/llm/services

> Get all enabled LLM services

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-api-keys"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{}},"paths":{"/api/v2/api/llm/services":{"get":{"summary":"Get all enabled LLM services","tags":["llm-api-keys"],"responses":{"200":{"description":"List of enabled services","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LLMService"}}}}}}}}}}
```

## GET /api/v2/api/llm/models/{serviceId}

> Get models for a specific service

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-api-keys"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/api/llm/models/{serviceId}":{"get":{"summary":"Get models for a specific service","tags":["llm-api-keys"],"parameters":[{"in":"path","name":"serviceId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"List of models for the service","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LLMModel"}}}}},"400":{"description":"Missing serviceId","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## PUT /api/v2/api/llm/{id}/model

> Update model for an API key

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-api-keys"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"UpdateModelRequest":{"type":"object","required":["modelId"],"properties":{"modelId":{"type":"number","description":"The id of a LLM model"}}},"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/api/llm/{id}/model":{"put":{"summary":"Update model for an API key","tags":["llm-api-keys"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateModelRequest"}}}},"responses":{"200":{"description":"Model updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing id or modelId","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"API key or model not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## GET /api/v2/api/llm

> Get all LLM API keys for user

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-api-keys"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{}},"paths":{"/api/v2/api/llm":{"get":{"summary":"Get all LLM API keys for user","tags":["llm-api-keys"],"responses":{"200":{"description":"List of user's API keys","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LLMApiKey"}}}}}}}}}}
```

## POST /api/v2/api/llm

> Create a new LLM API key

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-api-keys"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"CreateLLMApiKeyRequest":{"type":"object","required":["serviceId","modelId","apiKey"],"properties":{"name":{"type":"string","description":"The name of the API key max 255 characters"},"serviceId":{"type":"number","description":"The id of a LLM service"},"modelId":{"type":"number","description":"The id of a LLM model"},"apiKey":{"type":"string"}}},"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/api/llm":{"post":{"summary":"Create a new LLM API key","tags":["llm-api-keys"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLLMApiKeyRequest"}}}},"responses":{"201":{"description":"API key created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing required fields or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Service or model not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## DELETE /api/v2/api/llm/{id}

> Delete an LLM API key

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-api-keys"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/api/llm/{id}":{"delete":{"summary":"Delete an LLM API key","tags":["llm-api-keys"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"API key deleted successfully","content":{"application/json":{"schema":{"type":"string"}}}},"400":{"description":"Missing id or API key is in use","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.sigrex.io/api-reference/reference/api-keys/llm-api-keys.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
