## GET /v1/account/budget

Read account and developer spend limits and current usage.

Required permissions: read:account.
API key: Supported.
CLI user token: Supported.
Session token: Requires the ellipsis:api scope, and the session's permissions.ellipsis rules must allow the operation.
Higher permission levels include lower levels: read < write < delete.

### Response

```text
{
  "alerts": {
    "absolute_thresholds": {
      "day": int,
      "month": int,
      "week": int
    },
    "percent_thresholds": [
      int
    ]
  },
  "as_of": str,
  "credit_balance": int,
  "credit_exhausted": bool,
  "developer_limits": {
    "defaults": [
      {
        "limit": int,
        "platform_max": int,
        "window_days": int
      }
    ],
    "developers": [
      {
        "attribution_id": str,
        "attribution_type": str,
        "avatar_url": str,
        "developer_key": str,
        "login": str,
        "name": str,
        "windows": [
          {
            "exhausted": bool,
            "limit": int,
            "override": int,
            "remaining": int,
            "spent": int,
            "window_days": int
          }
        ]
      }
    ],
    "enabled": bool
  },
  "per_run": {
    "budget": int,
    "ceiling": int,
    "platform_max": int
  },
  "policy": {
    "account": {
      "day": int,
      "month": int,
      "week": int
    },
    "default_session": int,
    "developer_defaults": {
      "day": int,
      "month": int,
      "week": int
    },
    "developer_overrides": {
      "[str]": {
        "day": int,
        "month": int,
        "week": int
      }
    }
  },
  "windows": [
    {
      "exhausted": bool,
      "fraction_used": float,
      "limit": int,
      "platform_max": int,
      "remaining": int,
      "spent": int,
      "window_days": int
    }
  ]
}
```

### Python

```python
import os

from ellipsis import Ellipsis

client = Ellipsis(api_key=os.environ["ELLIPSIS_API_TOKEN"])

result = client.account.budget()
print(result)
```

### TypeScript

```typescript
import { Ellipsis } from '@ellipsis-dev/sdk';

const client = new Ellipsis({
  apiKey: process.env.ELLIPSIS_API_TOKEN!,
});

const result = await client.account.budget();
console.log(result);
```

### cURL

```bash
curl "https://api.ellipsis.dev/v1/account/budget" \
  -H "Authorization: Bearer $ELLIPSIS_API_TOKEN"
```

### Response schema

```json
{
  "properties": {
    "alerts": {
      "additionalProperties": false,
      "properties": {
        "absolute_thresholds": {
          "anyOf": [
            {
              "additionalProperties": false,
              "properties": {
                "day": {
                  "anyOf": [
                    {
                      "minimum": 100000,
                      "multipleOf": 1000,
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "month": {
                  "anyOf": [
                    {
                      "minimum": 100000,
                      "multipleOf": 1000,
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "week": {
                  "anyOf": [
                    {
                      "minimum": 100000,
                      "multipleOf": 1000,
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ]
        },
        "percent_thresholds": {
          "items": {
            "maximum": 100,
            "minimum": 1,
            "type": "integer"
          },
          "maxItems": 100,
          "minItems": 1,
          "type": "array"
        }
      },
      "required": [
        "percent_thresholds",
        "absolute_thresholds"
      ],
      "type": "object"
    },
    "as_of": {
      "format": "date-time",
      "type": "string"
    },
    "credit_balance": {
      "type": "integer"
    },
    "credit_exhausted": {
      "type": "boolean"
    },
    "developer_limits": {
      "properties": {
        "defaults": {
          "items": {
            "properties": {
              "limit": {
                "type": "integer"
              },
              "platform_max": {
                "type": "integer"
              },
              "window_days": {
                "type": "integer"
              }
            },
            "required": [
              "window_days",
              "limit",
              "platform_max"
            ],
            "type": "object"
          },
          "type": "array"
        },
        "developers": {
          "items": {
            "properties": {
              "attribution_id": {
                "type": "string"
              },
              "attribution_type": {
                "enum": [
                  "github_user",
                  "linear_user",
                  "slack_user",
                  "api_key"
                ],
                "type": "string"
              },
              "avatar_url": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "developer_key": {
                "type": "string"
              },
              "login": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "name": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "windows": {
                "items": {
                  "properties": {
                    "exhausted": {
                      "type": "boolean"
                    },
                    "limit": {
                      "type": "object"
                    },
                    "override": {
                      "type": "object"
                    },
                    "remaining": {
                      "type": "object"
                    },
                    "spent": {
                      "type": "integer"
                    },
                    "window_days": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "window_days",
                    "spent",
                    "limit",
                    "override",
                    "remaining",
                    "exhausted"
                  ],
                  "type": "object"
                },
                "type": "array"
              }
            },
            "required": [
              "developer_key",
              "attribution_type",
              "attribution_id",
              "login",
              "avatar_url",
              "name",
              "windows"
            ],
            "type": "object"
          },
          "type": "array"
        },
        "enabled": {
          "type": "boolean"
        }
      },
      "required": [
        "enabled",
        "defaults",
        "developers"
      ],
      "type": "object"
    },
    "per_run": {
      "properties": {
        "budget": {
          "type": "integer"
        },
        "ceiling": {
          "type": "integer"
        },
        "platform_max": {
          "type": "integer"
        }
      },
      "required": [
        "budget",
        "platform_max",
        "ceiling"
      ],
      "type": "object"
    },
    "policy": {
      "additionalProperties": false,
      "properties": {
        "account": {
          "additionalProperties": false,
          "properties": {
            "day": {
              "minimum": 100000,
              "multipleOf": 1000,
              "type": "integer"
            },
            "month": {
              "minimum": 100000,
              "multipleOf": 1000,
              "type": "integer"
            },
            "week": {
              "minimum": 100000,
              "multipleOf": 1000,
              "type": "integer"
            }
          },
          "required": [
            "day",
            "week",
            "month"
          ],
          "type": "object"
        },
        "default_session": {
          "minimum": 100000,
          "multipleOf": 1000,
          "type": "integer"
        },
        "developer_defaults": {
          "anyOf": [
            {
              "additionalProperties": false,
              "properties": {
                "day": {
                  "minimum": 100000,
                  "multipleOf": 1000,
                  "type": "integer"
                },
                "month": {
                  "minimum": 100000,
                  "multipleOf": 1000,
                  "type": "integer"
                },
                "week": {
                  "minimum": 100000,
                  "multipleOf": 1000,
                  "type": "integer"
                }
              },
              "required": [
                "day",
                "week",
                "month"
              ],
              "type": "object"
            },
            {
              "type": "null"
            }
          ]
        },
        "developer_overrides": {
          "items": {
            "additionalProperties": false,
            "properties": {
              "day": {
                "anyOf": [
                  {
                    "minimum": 100000,
                    "multipleOf": 1000,
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "month": {
                "anyOf": [
                  {
                    "minimum": 100000,
                    "multipleOf": 1000,
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "week": {
                "anyOf": [
                  {
                    "minimum": 100000,
                    "multipleOf": 1000,
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "type": "object"
          },
          "type": "object"
        }
      },
      "required": [
        "default_session",
        "account",
        "developer_defaults",
        "developer_overrides"
      ],
      "type": "object"
    },
    "windows": {
      "items": {
        "properties": {
          "exhausted": {
            "type": "boolean"
          },
          "fraction_used": {
            "type": "number"
          },
          "limit": {
            "type": "integer"
          },
          "platform_max": {
            "type": "integer"
          },
          "remaining": {
            "type": "integer"
          },
          "spent": {
            "type": "integer"
          },
          "window_days": {
            "type": "integer"
          }
        },
        "required": [
          "window_days",
          "spent",
          "limit",
          "remaining",
          "fraction_used",
          "exhausted",
          "platform_max"
        ],
        "type": "object"
      },
      "type": "array"
    }
  },
  "required": [
    "as_of",
    "credit_balance",
    "credit_exhausted",
    "policy",
    "alerts",
    "per_run",
    "windows",
    "developer_limits"
  ],
  "type": "object"
}
```
