Skip to main content
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.
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.

Operations

These operations manage agents. To run an agent and read its output, use the 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 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.
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.
  • 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.
  • 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.

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.

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.
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.
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.

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. 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.

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 until its status is SUCCEEDED or FAILED. Only the key that started the job can read it. See Async jobs.
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 switch: whether DinoAI may run SQL queries against the warehouse.

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. setConsumptionBudget takes one target, by its natural key. Set exactly one field of target: 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.
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.
deleteConsumptionBudget deletes a target’s budget, so the target is unlimited again. Deleting it again is not an error.

Errors

These are the cases specific to DinoAI. For the error format and the codes every area shares, see Errors.