> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paradime.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Administration API: DinoAI

> Create and change DinoAI agent definitions, set the agent graph, sync agents from code, change DinoAI settings, and set consumption budgets through the API.

Manage DinoAI from code: create, change, and delete agent definitions, set which agents delegate to which, import the agents committed in your repository, change the workspace's DinoAI settings, and set monthly consumption budgets.

> [!NOTE]
>
> **Prerequisites:**
>
> * These operations are available on every plan.
> * An account API key with the `X-Paradime-Workspace` header, or a workspace API key. The `platform` and `workspaceUid` budget targets need an account key.
> * The **DinoAI admin** capability group. To read an agent's `environment`, the key also needs **Environment admin**. To read a budget's `user`, it also needs **User access admin** or **User access viewer**.
>
> Keys, errors, pagination, and jobs work the same in every area. See [Conventions](https://docs.paradime.io/developers/graphql-api/admin-api/conventions.md).

## Operations

| Operation | Type | What it does | Capability group |
| - | - | - | - |
| [`Workspace.dinoAiAgentDefinitions`](https://docs.paradime.io/graphql-reference/types/Workspace) | Field | Lists the workspace's agent definitions, by slug. | DinoAI admin |
| [`Workspace.dinoAiAgentDefinition`](https://docs.paradime.io/graphql-reference/types/Workspace) | Field | Reads one agent definition by slug. | DinoAI admin |
| [`createDinoAiAgentDefinition`](https://docs.paradime.io/graphql-reference/mutations/createDinoAiAgentDefinition) | Mutation | Creates an agent definition. | DinoAI admin |
| [`updateDinoAiAgentDefinition`](https://docs.paradime.io/graphql-reference/mutations/updateDinoAiAgentDefinition) | Mutation | Replaces an agent's name, spec, and Slack bot settings. | DinoAI admin |
| [`deleteDinoAiAgentDefinition`](https://docs.paradime.io/graphql-reference/mutations/deleteDinoAiAgentDefinition) | Mutation | Deletes an agent definition. | DinoAI admin |
| [`setDinoAiAgentGraph`](https://docs.paradime.io/graphql-reference/mutations/setDinoAiAgentGraph) | Mutation | Replaces every delegation between the workspace's agents. | DinoAI admin |
| [`syncDinoAiAgentDefinitionsFromCode`](https://docs.paradime.io/graphql-reference/mutations/syncDinoAiAgentDefinitionsFromCode) | Mutation | Imports the agent definitions committed under `.dinoai/agents/`, as a job. | DinoAI admin |
| [`Workspace.dinoAiSettings`](https://docs.paradime.io/graphql-reference/types/Workspace) | Field | Reads the workspace's DinoAI settings. | DinoAI admin |
| [`setDinoAiWorkspaceSettings`](https://docs.paradime.io/graphql-reference/mutations/setDinoAiWorkspaceSettings) | Mutation | Changes the workspace's DinoAI settings. | DinoAI admin |
| [`consumptionBudgets`](https://docs.paradime.io/graphql-reference/queries/consumptionBudgets) | Query | Lists the DinoAI consumption budgets of the workspaces the key can reach. | DinoAI admin |
| [`setConsumptionBudget`](https://docs.paradime.io/graphql-reference/mutations/setConsumptionBudget) | Mutation | Creates or replaces the monthly budget of one target. | DinoAI admin |
| [`deleteConsumptionBudget`](https://docs.paradime.io/graphql-reference/mutations/deleteConsumptionBudget) | Mutation | Deletes a budget, so its target is unlimited again. | DinoAI admin |

These operations manage agents. To run an agent and read its output, use the [DinoAI Programmable Agents API](https://docs.paradime.io/developers/graphql-api/api-reference/dinoai-programmable-agents-api), with the **DinoAI agent API** group.

## Create an agent definition

`createDinoAiAgentDefinition` creates an agent in the targeted workspace, as [creating an agent in the app](https://docs.paradime.io/products/dino-ai/programmable-agents/creating-agents-in-the-app.md) does. `spec` holds what the agent is and may do: `role`, `goal`, and `backstory` are required.

Send your own `slug` to make the call safe to retry:

* With a `slug`, sending the same input again returns the agent unchanged. A `slug` that an agent with other settings holds is a `CONFLICT`.
* Without a `slug`, Paradime mints one from the name on every call, so a retried call creates another agent.
* A slug is lowercase letters, digits, and single hyphens, at most 80 characters. Slugs reserved for Paradime's own agents are refused.

```graphql theme={"system"}
mutation CreateAgent($input: CreateDinoAiAgentDefinitionInput!) {
  createDinoAiAgentDefinition(input: $input) {
    dinoAiAgentDefinition {
      slug
      name
      source
      role
      goal
      createdAt
    }
  }
}
```

```json theme={"system"}
{
  "input": {
    "slug": "freshness-triage",
    "name": "Freshness triage",
    "spec": {
      "role": "Data reliability engineer",
      "goal": "Find out why a source is stale and propose a fix.",
      "backstory": "You support the analytics team. Check source freshness and the recent Bolt runs before you answer.",
      "slack": {
        "channel": "#data-alerts",
        "answerIn": "THREAD",
        "updates": "FINAL"
      },
      "gitWrites": {
        "comment": true
      }
    }
  }
}
```

> [accordion] Example response
>
> ```json theme={"system"}
> {
>   "data": {
>     "createDinoAiAgentDefinition": {
>       "dinoAiAgentDefinition": {
>         "slug": "freshness-triage",
>         "name": "Freshness triage",
>         "source": "UI",
>         "role": "Data reliability engineer",
>         "goal": "Find out why a source is stale and propose a fix.",
>         "createdAt": "2026-11-26T11:20:05+00:00"
>       }
>     }
>   }
> }
> ```

A field you leave out of `spec` is unset on the agent:

* `model` picks a model tier (`HAIKU`, `SONNET`, or `OPUS`), and `modelFamily` a model family. Left out, the agent runs on the defaults. `modelFamily` must be a family your account offers: see [Supported models](https://docs.paradime.io/products/dino-ai/supported-models.md).
* `fallback: NONE` keeps the agent on its model family's own models: no fallback model answers when one fails. Left out, fallbacks are on.
* `environment` is the slug of the agent environment the agent runs in. Left out, it runs in the default agent environment.
* `tools` and `mcpTools` limit the Paradime tools and MCP server tools the agent may call: `ALLOWLIST` makes only the named tools available, and `DENYLIST` every tool except them. See the [tools reference](https://docs.paradime.io/products/dino-ai/programmable-agents/tools-reference.md).
* `slack` and `msTeams` set where the agent posts, `jira.defaultWatchers` who watches the issues it files, and `gitWrites` what it may do to pull requests. Each `gitWrites` permission is `false` by default.
* Outside `spec`, `slackBotName` and `slackBotIconUrl` set the name and icon of the agent's Slack messages. The icon URL must use `https://`.

The agent's delegates are not part of `spec`: set them with [`setDinoAiAgentGraph`](#set-the-agent-graph).

## Read agent definitions

`Workspace.dinoAiAgentDefinitions` lists the workspace's agents, ordered by slug, and `Workspace.dinoAiAgentDefinition` reads one by slug. `source` is `YAML` for an agent imported from `.dinoai/agents/`, and `UI` for one authored in Paradime or through the API. A `YAML` agent also has `gitPath`, `gitCommitSha`, and `syncedAt`.

```graphql theme={"system"}
query Agents {
  workspace {
    dinoAiAgentDefinitions(first: 50) {
      totalCount
      edges {
        node {
          slug
          name
          source
          gitPath
          syncedAt
          agentsSquad {
            edges {
              node {
                slug
              }
            }
          }
        }
      }
    }
  }
}
```

## Change or delete an agent definition

`updateDinoAiAgentDefinition` replaces an agent's `name`, `spec`, and Slack bot fields by slug, and keeps its delegates. Fields you leave out are cleared, including `slackBotName` and `slackBotIconUrl`, so send the full definition every time. Sending the same input again changes nothing. A slug that no agent holds is `NOT_FOUND`.

```graphql theme={"system"}
mutation UpdateAgent($input: UpdateDinoAiAgentDefinitionInput!) {
  updateDinoAiAgentDefinition(input: $input) {
    dinoAiAgentDefinition {
      slug
      updatedAt
    }
  }
}
```

```json theme={"system"}
{
  "input": {
    "slug": "freshness-triage",
    "name": "Freshness triage",
    "spec": {
      "role": "Data reliability engineer",
      "goal": "Find out why a source is stale and propose a fix.",
      "backstory": "You support the analytics team. Check source freshness and the recent Bolt runs before you answer.",
      "model": "SONNET",
      "slack": {
        "channel": "#data-alerts",
        "answerIn": "THREAD",
        "updates": "FINAL"
      }
    }
  }
}
```

`deleteDinoAiAgentDefinition` deletes an agent by slug. Deleting it again is not an error, and the slug is free to reuse. An agent that another agent delegates to can't be deleted: remove it from the graph first.

```graphql theme={"system"}
mutation DeleteAgent($input: DeleteDinoAiAgentDefinitionInput!) {
  deleteDinoAiAgentDefinition(input: $input) {
    deletedSlug
  }
}
```

```json theme={"system"}
{
  "input": {
    "slug": "freshness-triage"
  }
}
```

> [!NOTE]
>
> Create, update, and delete refuse an agent imported from `.dinoai/agents/` with `CONFLICT`, because the next sync from code would undo the change. Change its YAML file instead. See [YAML configuration](https://docs.paradime.io/products/dino-ai/programmable-agents/yaml-configuration.md).

## Set the agent graph

`setDinoAiAgentGraph` replaces every delegation between the workspace's agents. Each edge lets the agent `fromSlug` invoke the agent `toSlug`, as in [agent-to-agent delegation](https://docs.paradime.io/products/dino-ai/programmable-agents/agent-to-agent-delegation.md). An agent that is in no edge delegates to nobody. A cycle is refused.

Agents imported from `.dinoai/agents/` keep the delegates their YAML file lists (`agents_squad`). An edge from such an agent that its file doesn't list is a `CONFLICT`.

```graphql theme={"system"}
mutation SetGraph($input: SetDinoAiAgentGraphInput!) {
  setDinoAiAgentGraph(input: $input) {
    workspace {
      dinoAiAgentDefinition(slug: "pipeline-lead") {
        slug
        agentsSquad {
          edges {
            node {
              slug
            }
          }
        }
      }
    }
  }
}
```

```json theme={"system"}
{
  "input": {
    "edges": [
      { "fromSlug": "pipeline-lead", "toSlug": "freshness-triage" },
      { "fromSlug": "pipeline-lead", "toSlug": "model-reviewer" }
    ]
  }
}
```

## Sync agent definitions from code

`syncDinoAiAgentDefinitionsFromCode` imports the agent definitions committed under `.dinoai/agents/`, by slug. It reads `branch`, or the repository's default branch when you leave it out. It creates agents and replaces those with the same slug, and never deletes one. A file replaces an agent with the same slug even when the agent was authored in Paradime or through the API.

The sync runs as a job: poll [`adminJob`](https://docs.paradime.io/graphql-reference/queries/adminJob) until its `status` is `SUCCEEDED` or `FAILED`. Only the key that started the job can read it. See [Async jobs](https://docs.paradime.io/developers/graphql-api/admin-api/conventions.md#async-jobs).

```graphql theme={"system"}
mutation SyncAgents($input: SyncDinoAiAgentDefinitionsFromCodeInput!) {
  syncDinoAiAgentDefinitionsFromCode(input: $input) {
    job {
      id
      kind
      status
    }
  }
}
```

```json theme={"system"}
{
  "input": {
    "branch": "main"
  }
}
```

```graphql theme={"system"}
query SyncJob($jobId: String!) {
  adminJob(jobId: $jobId) {
    status
    failure {
      code
      reason
    }
    result {
      ... on DinoAiAgentSyncResult {
        added
        updated
        skipped
        branch
        commitSha
        isFetched
      }
    }
  }
}
```

```json theme={"system"}
{
  "jobId": "5d0b7c2e9a4f4e18"
}
```

> [accordion] Example response
>
> ```json theme={"system"}
> {
>   "data": {
>     "adminJob": {
>       "status": "SUCCEEDED",
>       "failure": null,
>       "result": {
>         "added": 2,
>         "updated": 1,
>         "skipped": 0,
>         "branch": "main",
>         "commitSha": "a41f9e2",
>         "isFetched": true
>       }
>     }
>   }
> }
> ```

`skipped` counts the files the sync skipped as invalid. `isFetched` is `false` when Paradime couldn't fetch the repository first, and read the commits it already had. A workspace with no git repository is a `CONFLICT`. A branch the repository doesn't have fails the job with `VALIDATION_FAILED`. A sync that doesn't finish within 10 minutes fails with `INTERNAL`.

## Change DinoAI settings

`setDinoAiWorkspaceSettings` changes the targeted workspace's DinoAI settings. A setting you leave out keeps its value, and `null` is refused. `sqlQueryToolEnabled` is the [DinoAI warehouse access](https://docs.paradime.io/products/settings/configuration/dinoai-warehouse-access.md) switch: whether DinoAI may run SQL queries against the warehouse.

```graphql theme={"system"}
mutation DinoAiSettings($input: SetDinoAiWorkspaceSettingsInput!) {
  setDinoAiWorkspaceSettings(input: $input) {
    workspace {
      dinoAiSettings {
        sqlQueryToolEnabled
      }
    }
  }
}
```

```json theme={"system"}
{
  "input": {
    "sqlQueryToolEnabled": true
  }
}
```

## Set consumption budgets

A consumption budget caps the DinoAI credits that one target may spend in a calendar month. A person's DinoAI use counts against their `USER` budget, then their workspace's and the account's. An agent's use counts against its `AGENT` budget, then `ALL_AGENTS`, the workspace's, and the account's. A target with no budget is unlimited. For how budgets apply, see [Budget & Consumption](https://docs.paradime.io/products/dino-ai/budget-and-consumption.md).

`setConsumptionBudget` takes one target, by its natural key. Set exactly one field of `target`:

| `target` field | Scope | Rule |
| - | - | - |
| `platform: true` | `PLATFORM`, the whole account | An account key granted every active workspace of the account |
| `workspaceUid` | `WORKSPACE`, one workspace | An account key granted that workspace |
| `userUid` | `USER`, one person in the targeted workspace | The person is, or was, a member of the workspace |
| `allAgents: true` | `ALL_AGENTS`, every agent of the targeted workspace together | |
| `agentSlug` | `AGENT`, one agent of the targeted workspace | The agent need not be defined yet |

`monthlyAllowance` is a number of credits, from 0 (no spend at all) up to 9223372036854775807. The app shows budgets in millions of credits: a 2M budget in the app is `2000000` in the API. Sending the same input again changes nothing.

```graphql theme={"system"}
mutation SetAgentBudget($input: SetConsumptionBudgetInput!) {
  setConsumptionBudget(input: $input) {
    consumptionBudget {
      scope
      agentSlug
      monthlyAllowance
      updatedAt
      workspace {
        uid
        name
      }
    }
  }
}
```

```json theme={"system"}
{
  "input": {
    "target": {
      "agentSlug": "freshness-triage"
    },
    "monthlyAllowance": 2000000
  }
}
```

`consumptionBudgets` lists the budgets of the workspaces the key can reach, oldest first. Narrow it with `workspaceUid` and `scopes`. An empty `scopes` list returns no budgets. The `PLATFORM` budget is listed only for an account key granted every active workspace of the account.

```graphql theme={"system"}
query Budgets($scopes: [ConsumptionBudgetScope!]) {
  consumptionBudgets(scopes: $scopes) {
    totalCount
    edges {
      node {
        scope
        workspace {
          uid
          name
        }
        userUid
        agentSlug
        monthlyAllowance
        updatedAt
      }
    }
  }
}
```

```json theme={"system"}
{
  "scopes": ["WORKSPACE", "AGENT"]
}
```

`deleteConsumptionBudget` deletes a target's budget, so the target is unlimited again. Deleting it again is not an error.

```graphql theme={"system"}
mutation DeleteAgentBudget($input: DeleteConsumptionBudgetInput!) {
  deleteConsumptionBudget(input: $input) {
    consumptionBudget {
      scope
      agentSlug
      monthlyAllowance
    }
  }
}
```

```json theme={"system"}
{
  "input": {
    "target": {
      "agentSlug": "freshness-triage"
    }
  }
}
```

## Errors

These are the cases specific to DinoAI. For the error format and the codes every area shares, see [Errors](https://docs.paradime.io/developers/graphql-api/admin-api/conventions.md#errors).

| Code | When |
| - | - |
| `CONFLICT` | The agent comes from `.dinoai/agents/`. A slug belongs to an agent with other settings. Another agent delegates to the agent you delete. A graph edge starts at a YAML agent whose file doesn't list it. A sync runs in a workspace with no git repository. |
| `NOT_FOUND` | No agent has the slug you update. No member, current or former, has the `userUid`. The key can't reach the `workspaceUid`. |
| `VALIDATION_FAILED` | A name or spec field is blank, the slug is not valid or is reserved, `modelFamily` is not available, `slackBotIconUrl` is not `https://`, or the graph has a cycle. A budget sets more or less than one `target` field, or `monthlyAllowance` is negative. A setting is `null`. |
| `MISSING_CAPABILITY` | A budget for `platform` from a key not granted every active workspace, or for `workspaceUid` from a workspace API key. |

## Related

* [Python SDK: DinoAI](https://docs.paradime.io/developers/python-sdk/modules/admin/dinoai.md): agent definitions, the agent graph, settings, and the sync in `paradime.admin.dinoai`. The SDK has no methods for consumption budgets.
* [Programmable agents](https://docs.paradime.io/products/dino-ai/programmable-agents/index.md): create agents in the app or in YAML, and how delegation works.
* [DinoAI Programmable Agents API](https://docs.paradime.io/developers/graphql-api/api-reference/dinoai-programmable-agents-api): run agents and read their output.
* [Budget & Consumption](https://docs.paradime.io/products/dino-ai/budget-and-consumption.md): budgets and spend in the app.
* [DinoAI warehouse access](https://docs.paradime.io/products/settings/configuration/dinoai-warehouse-access.md): the same setting in **Workspace Settings > General**.


## Related topics

- [Administration API: Usage](https://docs.paradime.io/developers/graphql-api/admin-api/usage.md)
- [DinoAI Programmable Agents API](https://docs.paradime.io/developers/graphql-api/api-reference/dinoai-programmable-agents-api.md)
- [August 19 improvements: Bolt, Discovery API, DinoAI](https://docs.paradime.io/changelog/2026-08-19/other-improvements.md)
- [Administration API](https://docs.paradime.io/developers/graphql-api/admin-api/index.md)
- [Administration API: Integrations](https://docs.paradime.io/developers/graphql-api/admin-api/integrations.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.