# AI

Flashback'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="/pages/FLyG0szOzAaXnic0aaLI"><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="/pages/NZ1W2AkWRO8JCMrihjvb"><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="/pages/K2wga7iZX2CN3AOiZQ9J"><strong>AI API Keys</strong></a></td><td>Create and manage scoped API keys that applications use to call AI endpoints via Flashback, 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**](/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**](/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**](/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}**](/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}**](/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**](/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**](/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**](/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}**](/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**](/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}**](/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**](/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**](/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**](/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**](/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}**](/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**](/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**](/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**](/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}**](/support-reference/platform-api-reference/ai-apis/ai-api-keys/delete__repo_-repoid-_ai_apikey.md) | Delete an AI API key.                     |


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flashback.tech/support-reference/platform-api-reference/ai-apis.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
