AI
Set Ask settings
Choose what Ask g1t answers with: provider_id, one of the workspace's AI providers, and model, one of the models it offers or auto for Auto (the default), which picks a model for each question.
PUT
/workspaces/{workspace}/ai/askWithout provider_id, Ask is off. Returns what Ask answers with now. Owners only.
model is one of the models the provider offers, or auto. Send provider_id null to turn Ask off.
- Authentication: Required. Send an access token as
Authorization: Bearer. - MCP tool:
aiwithactionset_ask, and the same inputs - Scope: An access token needs
workspace:admin.
Path parameters
Section titled “Path parameters”| Name | Type | Required | Description |
|---|---|---|---|
workspace |
string | Yes | The workspace’s slug, e.g. “flagon-io”. |
Body parameters
Section titled “Body parameters”Send a JSON object. Names are snake_case, as in responses; the camelCase spelling is accepted too.
| Name | Type | Required | Description |
|---|---|---|---|
provider_id |
string or null | No | The AI provider Ask answers with: one of the workspace’s, by id. Null or left out turns Ask off. |
model |
string | No | One of the models the provider offers, or auto for Auto: a model of the provider for each question. The provider’s own model (an endpoint’s, an Azure deployment) when left out. |
Example request
Section titled “Example request”curl -X PUT https://api.g1t.sh/workspaces/flagon-io/ai/ask \ -H "Authorization: Bearer $G1T_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "provider_id": "ai_01kpx4n8r3g9s0v5w7x1z2a3be", "model": "claude-sonnet-4-5" }'Example response
Section titled “Example response”A successful request answers 200 with:
{ "provider_id": "ai_01kpx4n8r3g9s0v5w7x1z2a3be", "provider_name": "Anthropic", "provider": "anthropic", "model": "claude-sonnet-4-5", "auto": false, "problem": null}Errors
Section titled “Errors”A failed request answers with one of these statuses and a body like {"error": {"code": "not_found", "message": "Repository not found."}}. See errors.
| Status | Code | When |
|---|---|---|
| 401 | unauthenticated |
A token is required, or the one sent is not valid. |
| 403 | forbidden |
The token is valid but not allowed to do this, such as a member-only change, or a token without the scope it needs. |
| 404 | not_found |
It does not exist, or you cannot see it. |
| 409 | conflict |
The request conflicts with the current state. |
| 422 | invalid |
The input is not valid. message says which field and why. |