# Credits

> Inspect your organization's monthly LOC credit allowance, remaining balance, and templates unlocked in the current UTC period.

## Read credits balance and unlocks

`GET https://shaw.ai/api/credits`

Returns the organization's current billing plan (Free 10,000 credits/month, Pro 100,000 credits/month, Operator 1,000,000 credits/month), monthly credit allowance, used and remaining monthly credits, never-expiring credit pack balance, Auto Top-Up settings, approximate LOC capacity (1 credit = 1 LOC), and permanently unlocked template pages with lifetime updates.

```json
{
  "openapi": "3.1.0",
  "info": {
    "description": "Shaw's API for people and agents. Everything you can do in the app, you can do here with an API key or an OAuth token, within the scopes you grant it.\n\nA scope only narrows a credential: every request still runs as the person who owns it, with their role in the organization.\n\nRoutes under /api/skills, /api/harness-profiles, /api/data-sync, /api/templates, /api/seo are reachable with the matching read or write scope (GET reads, everything else writes) even where no typed operation is listed here.\n\nWebhook events: approval.decided, session.completed, schedule.run.started, schedule.run.failed.\n\nMCP: https://shaw.ai/mcp (also https://shaw.ai/portal/mcp).",
    "title": "Shaw API",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://shaw.ai"
    }
  ],
  "paths": {
    "/api/credits": {
      "get": {
        "description": "Returns the organization's current billing plan (Free 10,000 credits/month, Pro 100,000 credits/month, Operator 1,000,000 credits/month), monthly credit allowance, used and remaining monthly credits, never-expiring credit pack balance, Auto Top-Up settings, approximate LOC capacity (1 credit = 1 LOC), and permanently unlocked template pages with lifetime updates.",
        "operationId": "get_credits_balance",
        "parameters": [
          {
            "$ref": "#/components/parameters/Tenant"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "oauth2": [
              "org:read"
            ]
          }
        ],
        "summary": "Read credits balance and unlocks",
        "tags": [
          "Credits"
        ],
        "x-mcp-tool": "get_credits_balance",
        "x-requires-confirmation": false,
        "x-required-scope": "org:read"
      }
    }
  },
  "components": {
    "parameters": {
      "Tenant": {
        "description": "The organization to act for (an id from `GET /api/me`). Defaults to the key's pinned organization, else your first organization. You must be a member of it.",
        "in": "header",
        "name": "X-Shaw-Tenant",
        "required": false,
        "schema": {
          "type": "string"
        }
      }
    },
    "responses": {
      "Error": {
        "content": {
          "application/json": {
            "schema": {
              "properties": {
                "error": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              },
              "type": "object"
            }
          }
        },
        "description": "The request was refused or failed; `error` is a stable code."
      },
      "Forbidden": {
        "content": {
          "application/json": {
            "schema": {
              "properties": {
                "error": {
                  "enum": [
                    "insufficient_scope",
                    "bearer_not_allowed",
                    "forbidden_workspace",
                    "tenant_pinned"
                  ],
                  "type": "string"
                },
                "message": {
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                }
              },
              "type": "object"
            }
          }
        },
        "description": "The credential lacks the scope, can't call this route, or can't act for the organization."
      },
      "Ok": {
        "content": {
          "application/json": {
            "schema": {}
          }
        },
        "description": "Success. The body is JSON."
      },
      "Unauthorized": {
        "content": {
          "application/json": {
            "schema": {
              "properties": {
                "error": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              },
              "type": "object"
            }
          }
        },
        "description": "The credential is missing, invalid, expired or revoked.",
        "headers": {
          "WWW-Authenticate": {
            "schema": {
              "type": "string"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "apiKey": {
        "bearerFormat": "sk_…",
        "description": "A personal API key created in Settings → Developers. Send it as `Authorization: Bearer sk_…`.",
        "scheme": "bearer",
        "type": "http"
      },
      "oauth2": {
        "description": "OAuth 2.1 authorization code with S256 PKCE. Clients can register themselves (RFC 7591).",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://shaw.ai/api/auth/oauth2/authorize",
            "refreshUrl": "https://shaw.ai/api/auth/oauth2/token",
            "scopes": {
              "org:read": "See which organizations you belong to, their profile and runtime status.",
              "org:write": "Create organizations and rename the ones you administer.",
              "sessions:read": "Read chat sessions, their messages and artifacts.",
              "sessions:write": "Start, rename, fork, compact and archive chat sessions and send messages.",
              "approvals:review": "Approve or reject the actions a session is waiting on.",
              "files:read": "Read shared files and documents.",
              "files:write": "Create, edit and delete shared files and documents.",
              "memory:read": "Read the knowledge base and shared memory.",
              "memory:write": "Add, edit, restore and delete knowledge entries.",
              "schedules:read": "Read scheduled automations.",
              "schedules:write": "Change and run scheduled automations.",
              "campaigns:read": "Read synced advertising, sales and Meta/Google campaign data.",
              "campaigns:write": "Run syncs and publish or change ad campaigns.",
              "reports:read": "Read SEO reports and research.",
              "reports:write": "Run and change SEO reports and research.",
              "pages:read": "Read template catalog metadata, code size/credits, Brand Kit, remixes, hosted pages, custom domains, and Email Studio drafts.",
              "pages:write": "Update Brand Kit, create or edit remixes, publish hosted pages or domains, and edit or publish Email Studio drafts.",
              "connectors:read": "See which apps and providers are connected, without any credentials.",
              "connectors:manage": "Disconnect apps, forget saved provider keys and manage MCP servers. Connecting an app or entering a credential needs you signed in.",
              "members:read": "See who belongs to an organization and their roles.",
              "members:manage": "Invite people and change or remove members.",
              "settings:read": "Read workspace settings, tool policy, skills and models.",
              "settings:write": "Change workspace settings, tool policy and skills.",
              "webhooks:manage": "Create, list and delete outbound webhooks.",
              "events:read": "Read the activity feed and webhook delivery log.",
              "tools:read": "Use read-only integration tools (Shopify, Klaviyo and others) the organization has connected.",
              "tools:write": "Use integration tools that change data in connected apps. Writes still follow the organization's tool policy."
            },
            "tokenUrl": "https://shaw.ai/api/auth/oauth2/token"
          }
        },
        "type": "oauth2"
      }
    },
    "schemas": {}
  }
}
```
