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

# Create AI budget

> Create a monthly AI spending limit, with the scope and limit in one input.

`createAiBudget(input: CreateAiBudgetInput!): AiBudget!`

**Deprecated.** Renamed; the budget is an explicit argument.

Use Create budget (`Mutation.createBudget`) instead.

**Deprecated:** Use createBudget. (CR-billing-legacy-names)

## Arguments

| Argument | Type | Required |
| - | - | - |
| `input` | [`CreateAiBudgetInput!`](https://veryfront.com/docs/cloud/graphql/types/createaibudgetinput) | Yes |

## Input fields

### input

[`CreateAiBudgetInput`](https://veryfront.com/docs/cloud/graphql/types/createaibudgetinput)

| Field | Type | Required | Description |
| - | - | - | - |
| `scope` | [`AiBudgetScopeInput!`](https://veryfront.com/docs/cloud/graphql/types/aibudgetscopeinput) | Yes | |
| `monthlyLimitCredits` | [`Float`](https://veryfront.com/docs/cloud/graphql/types/float) | No | Monthly AI spending limit in credits. Usage already recorded this month counts toward the limit. Supply exactly one of the credit or the deprecated USD limit. |
| `monthlyLimitUsd` | [`Float`](https://veryfront.com/docs/cloud/graphql/types/float) | No | Monthly limit in USD, converted to credits at the published credit price. Deprecated: Use monthlyLimitCredits. |

## Response

Returns [`AiBudget!`](https://veryfront.com/docs/cloud/graphql/types/aibudget). Open the type for its fields and nested types.

| Field | Type |
| - | - |
| `id` | [`ID!`](https://veryfront.com/docs/cloud/graphql/types/id) |
| `scope` | [`AiBudgetScope!`](https://veryfront.com/docs/cloud/graphql/types/aibudgetscope) |
| `monthlyLimitUsd` | [`Float!`](https://veryfront.com/docs/cloud/graphql/types/float) |
| `monthlyLimitCredits` | [`Float!`](https://veryfront.com/docs/cloud/graphql/types/float) |
| `status` | [`AiBudgetStatus!`](https://veryfront.com/docs/cloud/graphql/types/aibudgetstatus) |
| `createdAt` | [`String!`](https://veryfront.com/docs/cloud/graphql/types/string) |
| `updatedAt` | [`String!`](https://veryfront.com/docs/cloud/graphql/types/string) |

Types marked with `!` cannot be null. Lists use `[Type]` notation. The [type index](https://veryfront.com/docs/cloud/graphql/schema.md) lists all published input and response types.

## Example

```graphql title="query.graphql" theme={null}
mutation CreateAiBudget($input: CreateAiBudgetInput!) {
  createAiBudget(input: $input) {
    id
    createdAt
    updatedAt
    monthlyLimitCredits
    monthlyLimitUsd
  }
}
```

```json title="variables.json" theme={null}
{
  "input": {
    "scope": {
      "projectReference": "example-project"
    },
    "monthlyLimitCredits": 100
  }
}
```

<details>
  <summary>Try this mutation</summary>

  Calls use `https://api.veryfront.com/graphql`. Replace sample values with resources you can access. See [Authentication](https://veryfront.com/docs/cloud/authentication.md) for credentials and permissions.

  Bearer token or API key

  Stored in this tab's session. Clear credential

  Mutation

  Variables (JSON)
</details>


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