> For the complete documentation index, see [llms.txt](https://docs.flashback.tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flashback.tech/support-reference/platform-api-reference/ai-apis.md).

# AI

Flashgate's AI layer combines **AI LLM management** with a flexible **AI Policy** system. You can securely configure multiple AI providers (OpenAI, Google Cloud's Gemini, Anthropic) per workspace, then govern their usage with natural-language policies scoped at organization, workspace, or repository level. Together, they give you centralized control over credentials, usage, compliance, and real-time enforcement of responsible AI behavior across your apps and repositories.

## Reference Table

<table><thead><tr><th width="226.7999267578125">Category</th><th>Description</th></tr></thead><tbody><tr><td><a href="https://docs.flashback.tech/support-reference/platform-api-reference/ai-apis/ai-llms.md"><strong>AI LLMs</strong></a></td><td>Configure and manage connections to external AI providers (e.g., OpenAI-compatible, cloud LLMs), validate credentials, and make these models available to workspaces and repositories under a unified interface.</td></tr><tr><td><a href="https://docs.flashback.tech/support-reference/platform-api-reference/ai-apis/ai-policy.md"><strong>AI Policy</strong></a></td><td>Define and enforce natural-language governance rules (e.g., PII handling, security, content boundaries) with risk levels and actions (log, alert, block), scoped at organization, workspace, or repository level.</td></tr><tr><td><a href="https://docs.flashback.tech/support-reference/platform-api-reference/ai-apis/ai-api-keys.md"><strong>AI API Keys</strong></a></td><td>Create and manage scoped API keys that applications use to call AI endpoints via Flashgate, controlling which LLM configurations and repositories they can access and how much usage they are allowed.</td></tr></tbody></table>

## AI API Calls

The table below consolidates all AI-related endpoints across the three sub-categories.

### AI LLM Management

| Method                                                           | API Reference                                                                                                                                                       | Description                                                      |
| ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |
| <mark style="color:orange;">`POST`</mark>`/ai/llm`               | [**post\_\_ai\_llm**](https://docs.flashback.tech/support-reference/platform-api-reference/ai-apis/ai-llms/post_ai_llm.md)                                          | Create a new AI LLM configuration.                               |
| <mark style="color:green;">`GET`</mark>`/ai/llm`                 | [**get\_\_ai\_llm**](https://docs.flashback.tech/support-reference/platform-api-reference/ai-apis/ai-llms/get_ai_llm.md)                                            | List all AI LLM configurations (with optional workspace filter). |
| <mark style="color:green;">`GET`</mark>`/ai/llm/available`       | [**get\_\_ai\_llm\_available**](https://docs.flashback.tech/support-reference/platform-api-reference/ai-apis/ai-llms/get_ai_llm_available.md)                       | Get available configurations ready for use.                      |
| <mark style="color:blue;">`PUT`</mark>`/ai/llm/{id}`             | [**put\_\_ai\_llm\_{aillmid}**](https://docs.flashback.tech/support-reference/platform-api-reference/ai-apis/ai-llms/put__ai_llm_-aillmid.md)                       | Update an existing AI LLM configuration.                         |
| <mark style="color:red;">`DELETE`</mark>`/ai/llm/{id}`           | [**delete\_\_ai\_llm\_{aillmId}**](https://docs.flashback.tech/support-reference/platform-api-reference/ai-apis/ai-llms/delete__ai_llm_-aillmid.md)                 | Delete an AI LLM configuration.                                  |
| <mark style="color:orange;">`POST`</mark>`/ai/llm/{id}/validate` | [**post\_\_ai\_llm\_{aillmId}\_validate**](https://docs.flashback.tech/support-reference/platform-api-reference/ai-apis/ai-llms/post__ai_llm_-aillmid-_validate.md) | Validate an AI LLM configuration.                                |
| <mark style="color:green;">`GET`</mark>`/ai/llm/stats`           | [**get\_\_ai\_llm\_stats**](https://docs.flashback.tech/support-reference/platform-api-reference/ai-apis/ai-llms/get__ai_llm_stats.md)                              | Get usage statistics for AI LLM configurations.                  |

### AI Policy

| Method                                                                 | API Reference                                                                                                                                                            | Description                                         |
| ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------- |
| <mark style="color:orange;">`POST`</mark>`/policy`                     | [**post\_\_policy**](https://docs.flashback.tech/support-reference/platform-api-reference/ai-apis/ai-policy/post__policy.md)                                             | Create a new AI policy.                             |
| <mark style="color:blue;">`PUT`</mark>`/policy/{policyId}`             | [**put\_\_policy\_{policyId}**](https://docs.flashback.tech/support-reference/platform-api-reference/ai-apis/ai-policy/put__policy_-policyid.md)                         | Update an existing policy.                          |
| <mark style="color:green;">`GET`</mark>`/policy`                       | [**get\_\_policy**](https://docs.flashback.tech/support-reference/platform-api-reference/ai-apis/ai-policy/get__policy.md)                                               | List policies with optional filtering.              |
| <mark style="color:green;">`GET`</mark>`/policy/{policyId}`            | [**get\_\_policy\_{policyId}**](https://docs.flashback.tech/support-reference/platform-api-reference/ai-apis/ai-policy/get__policy_-policyid.md)                         | Get detailed information about a specific policy.   |
| <mark style="color:green;">`GET`</mark>`/policy/violations`            | [**get\_\_policy\_violations**](https://docs.flashback.tech/support-reference/platform-api-reference/ai-apis/ai-policy/get__policy_violations.md)                        | Retrieve policy violations across AI operations.    |
| <mark style="color:green;">`GET`</mark>`/policy/{policyId}/violations` | [**get\_\_policy\_{policyId}\_violations**](https://docs.flashback.tech/support-reference/platform-api-reference/ai-apis/ai-policy/get__policy_-policyid-_violations.md) | Retrieve all violations for a specific policy.      |
| <mark style="color:green;">`GET`</mark>`/policy/alerts`                | [**get\_\_policy\_alerts**](https://docs.flashback.tech/support-reference/platform-api-reference/ai-apis/ai-policy/get__policy_alerts.md)                                | Retrieve all policy alerts with optional filtering. |
| <mark style="color:green;">`GET`</mark>`/policy/{policyId}/alerts`     | [**get\_\_policy\_{policyId}\_alerts**](https://docs.flashback.tech/support-reference/platform-api-reference/ai-apis/ai-policy/get__policy_-policyid-_alerts.md)         | Retrieve all alerts for a specific policy.          |
| <mark style="color:red;">`DELETE`</mark>`/policy/{policyId}`           | [**delete\_\_policy\_{policyId}**](https://docs.flashback.tech/support-reference/platform-api-reference/ai-apis/ai-policy/delete__policy_-policyid.md)                   | Permanently delete an AI governance policy.         |

### AI API Keys

| Method                                                                        | API Reference                                                                                                                                                                       | Description                               |
| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------- |
| <mark style="color:orange;">`POST`</mark>`/repo/{repoId}/ai/apikey`           | [**post\_\_repo\_{repoId}\_ai\_apikey**](https://docs.flashback.tech/support-reference/platform-api-reference/ai-apis/ai-api-keys/post__repo_-repoid-_ai_apikey.md)                 | Create a new AI API key for a repository. |
| <mark style="color:blue;">`PUT`</mark>`/repo/{repoId}/ai/apikey`              | [**put\_\_repo\_{repoId}\_ai\_apikey**](https://docs.flashback.tech/support-reference/platform-api-reference/ai-apis/ai-api-keys/put__repo_-repoid-_ai_apikey.md)                   | Update an AI API key's properties.        |
| <mark style="color:green;">`GET`</mark>`/repo/{repoId}/ai/apikey`             | [**get\_\_repo\_{repoId}\_ai\_apikey**](https://docs.flashback.tech/support-reference/platform-api-reference/ai-apis/ai-api-keys/get__repo_-repoid-_ai_apikey.md)                   | List all AI API keys for a repository.    |
| <mark style="color:red;">`DELETE`</mark>`/repo/{repoId}/ai/apikey/{apikeyId}` | [**delete\_\_repo\_{repoId}\_ai\_apikey\_{apikeyId}**](https://docs.flashback.tech/support-reference/platform-api-reference/ai-apis/ai-api-keys/delete__repo_-repoid-_ai_apikey.md) | Delete an AI API key.                     |


---

# 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.flashback.tech/support-reference/platform-api-reference/ai-apis.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.
