# Get AI credits

> GET /me/credits

Source: https://mockflow.com/developers/reference/me/get-credits

**GET** `https://api.mockflow.com/v1/me/credits`  
Scopes: `user:read`

**curl**

```bash
curl https://api.mockflow.com/v1/me/credits \
  -H "Authorization: Bearer $MOCKFLOW_API_KEY"
```

**JavaScript**

```javascript
const response = await fetch("https://api.mockflow.com/v1/me/credits", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.MOCKFLOW_API_KEY}`
  }
});

const data = await response.json();
```

**Python**

```python
import os, requests

response = requests.get(
    "https://api.mockflow.com/v1/me/credits",
    headers={"Authorization": f"Bearer {os.environ['MOCKFLOW_API_KEY']}"},
)

response.raise_for_status()
data = response.json()
```

**200**

```json
{
  "remaining": 0,
  "total": 0,
  "messages": {
    "remaining": 0,
    "total": 0
  },
  "resetsAt": "2026-10-01T09:30:00Z",
  "canGenerate": false
}
```

**429**

```json
{
  "error": {
    "code": "rate_limited",
    "message": "Too many requests.",
    "docsUrl": "https://mockflow.com/developers/concepts/errors#rate_limited"
  },
  "requestId": "req_45d49816999bac40"
}
```

The AI credit wallet and the Mida message quota, both metered per workspace and reset monthly.

### Authorization

- `Authorization` (string, required): `Bearer <key>`. The key needs `user:read` scope. Create and manage keys in the [developer console](/developers/console/); what each scope unlocks is on the [scopes page](/developers/concepts/scopes).

### Response

- `remaining` (integer)
- `total` (integer)
- `messages` (object | null): The Mida message quota, a second counter the product enforces.
    - `remaining` (integer)
  - `total` (integer)
- `resetsAt` (string)
- `canGenerate` (boolean): False on Basic, which cannot spend model time through the API.

### Errors

- 429 `rate_limited`: Too many requests.
