PayWithLocus Resources API

Durable resources an agent bought, such as phone numbers, inboxes and sandboxes

GitHub OpenAPI

Operations 5

GET /credits/resources List durable resources an agent bought #
GET /credits/resources/facets List every service and end user you have resources under #
GET /credits/resources/{resourceId} Read one resource, including its current renewal price #
POST /credits/resources/{resourceId}/release Release a resource through its provider #
POST /credits/resources/{resourceId}/renew Renew a resource, refused before any charge above max_cost_usd #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/paywithlocus-com:paywithlocus-com-resources-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

paywithlocus-com-resources-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Locus Pro Resources API
  description: Production is live at https://api.paywithlocus.com/api. Stage remains available for evaluation and integration testing at https://api.stage.paywithlocus.com/api; credentials, balances, and tenant data are isolated by environment. Embedded prepaid credits over the Locus pay-per-use catalog. Money and top-up amounts use exact decimal strings (up to 6dp). Every burn requires an Idempotency-Key header. Management routes accept a tenant secret key or authorized dashboard session as shown per operation. High-risk operations protected by workspace-administrator step-up require an owner or admin dashboard session, the applicable scope, and MFA/passkey authentication completed in the last ten minutes; developer, billing, viewer, and secret-key principals remain ineligible even when a matching scope is present. Scoped secret keys retain only the explicitly documented Agent Connection lifecycle exception. Widget routes accept an end-user JWT alone; when a publishable key is present it must belong to the JWT's tenant. MCP uses OAuth 2.1 Authorization Code with PKCE by default and also accepts the explicitly documented tenant secret key, end-user JWT, or scoped agent connection compatibility credentials. Burns accept the execution credentials shown per operation. Publishable keys never authorize management or burns by themselves.
  version: 0.7.0
servers:
- url: https://api.paywithlocus.com/api
  description: Production
- url: https://api.stage.paywithlocus.com/api
  description: Stage — evaluation and integration testing
security:
- secretKey: []
tags:
- name: Resources
  description: Durable resources an agent bought, such as phone numbers, inboxes and sandboxes
paths:
  /credits/resources:
    get:
      tags:
      - Resources
      summary: List durable resources an agent bought
      operationId: getCreditsResources
      description: Rows are sorted newest first. End-user-bound callers see only their own resources. When auto_renews is true, billing renews the row on its own and expires_at is the next renewal.
      security:
      - dashboardSession: []
      - secretKey: []
      - sandboxKey: []
      - endUserToken: []
      - agentConnection: []
      parameters:
      - name: status
        in: query
        schema:
          type: string
          enum:
          - all
          - active
          - expiring
          - released
          default: all
      - name: service
        in: query
        schema:
          type: string
          maxLength: 128
      - name: end_user
        in: query
        description: Workspace callers only. An end-user-bound caller always sees only its own rows.
        schema:
          type: string
          maxLength: 256
      - name: cursor
        in: query
        schema:
          type: string
          maxLength: 200
      responses:
        '200':
          description: Up to 50 resources and a next_cursor for the next page
        '401':
          description: Missing or invalid credential
  /credits/resources/facets:
    get:
      tags:
      - Resources
      summary: List every service and end user you have resources under
      operationId: getCreditsResourcesFacets
      description: Use these to fill filters. Not narrowed by list filters. End-user-bound callers see only their own.
      security:
      - dashboardSession: []
      - secretKey: []
      - sandboxKey: []
      - endUserToken: []
      - agentConnection: []
      responses:
        '200':
          description: services and end_users, each a sorted list of strings
        '401':
          description: Missing or invalid credential
  /credits/resources/{resourceId}:
    get:
      tags:
      - Resources
      summary: Read one resource, including its current renewal price
      operationId: getCreditsResourcesByResourceId
      description: Returns one resource owned by the caller, including its current renewal price. Returns 404 when the resource does not exist or belongs to someone else.
      security:
      - dashboardSession: []
      - secretKey: []
      - sandboxKey: []
      - endUserToken: []
      - agentConnection: []
      parameters:
      - $ref: '#/components/parameters/ResourceId'
      responses:
        '200':
          description: The resource
        '404':
          description: Not found or not yours
  /credits/resources/{resourceId}/release:
    post:
      tags:
      - Resources
      summary: Release a resource through its provider
      operationId: postCreditsResourcesByResourceIdRelease
      description: The row is marked released only after the provider confirms, or answers that it is already gone.
      security:
      - dashboardSession: []
      - secretKey: []
      - endUserToken: []
      - agentConnection: []
      parameters:
      - $ref: '#/components/parameters/ResourceId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
              - idempotency_key
              properties:
                idempotency_key:
                  type: string
                  minLength: 1
                  maxLength: 255
      responses:
        '200':
          description: Released, with the updated row
        '202':
          description: Still processing; the row is returned unchanged
        '404':
          description: Not found or not yours
  /credits/resources/{resourceId}/renew:
    post:
      tags:
      - Resources
      summary: Renew a resource, refused before any charge above max_cost_usd
      operationId: postCreditsResourcesByResourceIdRenew
      description: Read the resource first and pass its renewal.price_usd as max_cost_usd. A higher price at renewal time is refused before any charge.
      security:
      - dashboardSession: []
      - secretKey: []
      - endUserToken: []
      - agentConnection: []
      parameters:
      - $ref: '#/components/parameters/ResourceId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
              - idempotency_key
              - max_cost_usd
              properties:
                idempotency_key:
                  type: string
                  minLength: 1
                  maxLength: 255
                max_cost_usd:
                  $ref: '#/components/schemas/DecimalString'
      responses:
        '200':
          description: Renewed, with the updated row
        '202':
          description: Still processing; the row is returned unchanged
        '404':
          description: Not found or not yours
        '409':
          description: 'charge_ceiling_exceeded: the live price exceeds max_cost_usd'
components:
  schemas:
    DecimalString:
      type: string
      pattern: ^\d+(?:\.\d{1,6})?$
      description: Non-negative exact decimal string with at most six fractional digits. Endpoint-specific positivity and amount limits still apply.
  parameters:
    ResourceId:
      name: resourceId
      in: path
      required: true
      schema:
        type: string
        format: uuid
  securitySchemes:
    secretKey:
      type: http
      scheme: bearer
      description: Tenant secret key (lcr_…). Server-side only.
    sandboxKey:
      type: http
      scheme: bearer
      description: 'Sandbox key (lcrsb_…). Metered calls are simulated: no credits move, no providers are called. No management access. Simulation is served from fixtures for the hosted provider catalog; external-rail providers are not registered with the sandbox interceptor and answer 404.'
    endUserToken:
      type: http
      scheme: bearer
      description: 60-3600 second end-user JWT minted via /credits/end-users/{id}/token. If the JWT has sid, send the original session value in X-Locus-Session-Id; sid contains only its SHA-256 fingerprint. Bearer tokens are replayable until expiry; use short TTLs, optional session binding, and Idempotency-Key on operations.
    publishableKey:
      type: apiKey
      in: header
      name: X-Locus-Publishable-Key
      description: 'Widget calls: rides alongside the end-user token.'
    dashboardSession:
      type: http
      scheme: bearer
      description: Locus Pro dashboard session (Cognito). High-risk workspace administration requires an owner or admin role and fresh MFA/passkey step-up.
    mcpOAuth:
      type: oauth2
      description: Primary authentication for the hosted MCP resource. Public clients use Authorization Code with PKCE S256. mcp:read covers discovery and resource reads; billed tools/call additionally requires mcp:execute; offline_access requests a rotating refresh token.
      flows:
        authorizationCode:
          authorizationUrl: https://api.paywithlocus.com/api/credits/mcp/oauth/authorize
          tokenUrl: https://api.paywithlocus.com/api/credits/mcp/oauth/token
          refreshUrl: https://api.paywithlocus.com/api/credits/mcp/oauth/token
          scopes:
            mcp:read: Discover and read the authenticated MCP catalog and resources.
            mcp:execute: Execute billed MCP tools.
            offline_access: Issue and rotate a persistent refresh token.
    mcpRegistrationToken:
      type: http
      scheme: bearer
      description: Dynamic-client registration access token returned once when the MCP OAuth client is created. It remains valid only for that client's registration management URI.
    agentConnection:
      type: http
      scheme: bearer
      description: Scoped lcac_ credential. Tenant-managed Agent Connections authorize only their bound MCP and wrapped execution surfaces. A bootstrap connection for a self-registered agent additionally authorizes the explicit /credits/agent/* self-service routes for its own account; neither form authorizes general tenant management.
    okibiIdentity:
      type: http
      scheme: bearer
      bearerFormat: Okibi capability
      description: Short-lived capability injected only by an Identity-eligible signed Okibi CLI release. It is verified by @okibi/partner-kit for issuer, audience, installation, grant activity, and required route scopes. Never persist or copy it into native Locus configuration.