PayWithLocus Custom APIs API

Feature-gated enterprise BYOK providers and schema-backed custom actions

GitHub OpenAPI

Operations 7

GET /credits/custom-endpoints List custom API providers and actions #
POST /credits/custom-endpoints Create a custom API provider #
PATCH /credits/custom-endpoints/{providerId} Update a custom API provider #
DELETE /credits/custom-endpoints/{providerId} Delete a custom API provider #
POST /credits/custom-endpoints/{providerId}/endpoints Create an action for a custom provider #
PATCH /credits/custom-endpoints/{providerId}/endpoints/{endpointId} Update a custom API action #
DELETE /credits/custom-endpoints/{providerId}/endpoints/{endpointId} Delete a custom API action #

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-custom-apis-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-custom-apis-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Locus Pro Custom APIs 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: Custom APIs
  description: Feature-gated enterprise BYOK providers and schema-backed custom actions
paths:
  /credits/custom-endpoints:
    get:
      tags:
      - Custom APIs
      summary: List custom API providers and actions
      operationId: getCreditsCustomEndpoints
      description: Feature-gated enterprise management surface. Requires catalog:write. The raw upstream credential is never returned. Only a workspace owner whose credential also has credentials:manage receives the provider base URL and redacted authentication metadata; every other authorized caller receives null for those upstream configuration fields.
      security:
      - dashboardSession: []
      - secretKey: []
      x-required-scopes:
      - catalog:write
      responses:
        '200':
          description: Custom providers, effective workspace markup cap, and schema-backed actions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomProviderListResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedManagement'
        '403':
          description: Custom APIs are not enabled for this enterprise workspace or the credential lacks catalog:write
    post:
      tags:
      - Custom APIs
      summary: Create a custom API provider
      operationId: postCreditsCustomEndpoints
      description: Creates one BYOK provider and optionally up to 50 actions atomically. Requires an enterprise workspace with Custom APIs enabled, the workspace owner, credentials:manage and catalog:write, plus MFA or passkey step-up completed in the last ten minutes. Locus validates the upstream URL against SSRF controls, encrypts the credential, validates every JSON Schema and example, and never returns the raw credential.
      security:
      - dashboardSession: []
      x-required-scopes:
      - credentials:manage
      - catalog:write
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomProviderCreateRequest'
      responses:
        '201':
          description: Provider and any supplied actions created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomProviderResponse'
        '400':
          description: Invalid URL, authentication, traffic policy, schema, example, route, or pricing
        '403':
          description: Feature, enterprise plan, owner, scope, or recent step-up requirement not met
        '409':
          description: That provider slug is already in use in this workspace
  /credits/custom-endpoints/{providerId}:
    patch:
      tags:
      - Custom APIs
      summary: Update a custom API provider
      operationId: patchCreditsCustomEndpointsByProviderId
      description: Updates provider presentation, SSRF-checked base URL, authentication, or traffic protection. Supplying a new credential rotates the encrypted secret; type=none removes it. Requires the same enterprise owner, scope, and recent step-up controls as creation.
      security:
      - dashboardSession: []
      x-required-scopes:
      - credentials:manage
      - catalog:write
      parameters:
      - $ref: '#/components/parameters/CustomProviderId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomProviderUpdateRequest'
      responses:
        '200':
          description: Provider updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomProviderResponse'
        '400':
          description: No changes or invalid configuration
        '403':
          description: Feature, enterprise plan, owner, scope, or recent step-up requirement not met
        '404':
          description: Custom provider not found in this workspace
    delete:
      tags:
      - Custom APIs
      summary: Delete a custom API provider
      operationId: deleteCreditsCustomEndpointsByProviderId
      description: Permanently removes the provider, its encrypted upstream credential, and its custom actions. Requires the same enterprise owner, scope, and recent step-up controls as creation.
      security:
      - dashboardSession: []
      x-required-scopes:
      - credentials:manage
      - catalog:write
      parameters:
      - $ref: '#/components/parameters/CustomProviderId'
      responses:
        '204':
          description: Provider and actions deleted
        '403':
          description: Feature, enterprise plan, owner, scope, or recent step-up requirement not met
        '404':
          description: Custom provider not found in this workspace
  /credits/custom-endpoints/{providerId}/endpoints:
    post:
      tags:
      - Custom APIs
      summary: Create an action for a custom provider
      operationId: postCreditsCustomEndpointsByProviderIdEndpoints
      description: Creates one disabled-by-default or explicitly enabled action. Its input schema must describe an object, its example must validate, path placeholders must resolve to scalar schema properties, and the top-level names externalUserId, attribution, and _locus are reserved for Locus transport controls. Publishing an enabled action requires a positive end-user price.
      security:
      - dashboardSession: []
      x-required-scopes:
      - credentials:manage
      - catalog:write
      parameters:
      - $ref: '#/components/parameters/CustomProviderId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomEndpointCreateRequest'
      responses:
        '201':
          description: Action created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomEndpointResponse'
        '400':
          description: Invalid schema, example, path, pricing, or action configuration
        '403':
          description: Feature, enterprise plan, owner, scope, or recent step-up requirement not met
        '404':
          description: Custom provider not found in this workspace
        '409':
          description: That action slug is already in use for this provider
  /credits/custom-endpoints/{providerId}/endpoints/{endpointId}:
    patch:
      tags:
      - Custom APIs
      summary: Update a custom API action
      operationId: patchCreditsCustomEndpointsByProviderIdEndpointsByEndpointId
      description: Updates one action without changing its stable slug. Contract and pricing changes are revalidated; a pricing change increments pricingRevision. Requires the enterprise owner with credentials:manage, catalog:write, and recent step-up.
      security:
      - dashboardSession: []
      x-required-scopes:
      - credentials:manage
      - catalog:write
      parameters:
      - $ref: '#/components/parameters/CustomProviderId'
      - $ref: '#/components/parameters/CustomEndpointId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomEndpointUpdateRequest'
      responses:
        '200':
          description: Action updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomEndpointResponse'
        '400':
          description: No changes or invalid schema, example, path, pricing, or action configuration
        '403':
          description: Feature, enterprise plan, owner, scope, or recent step-up requirement not met
        '404':
          description: Custom provider or action not found in this workspace
    delete:
      tags:
      - Custom APIs
      summary: Delete a custom API action
      operationId: deleteCreditsCustomEndpointsByProviderIdEndpointsByEndpointId
      description: Permanently removes one custom action. Requires the enterprise owner with credentials:manage, catalog:write, and recent step-up.
      security:
      - dashboardSession: []
      x-required-scopes:
      - credentials:manage
      - catalog:write
      parameters:
      - $ref: '#/components/parameters/CustomProviderId'
      - $ref: '#/components/parameters/CustomEndpointId'
      responses:
        '204':
          description: Action deleted
        '403':
          description: Feature, enterprise plan, owner, scope, or recent step-up requirement not met
        '404':
          description: Custom provider or action not found in this workspace
components:
  schemas:
    CustomTrafficPolicyUpdate:
      type: object
      additionalProperties: false
      minProperties: 1
      properties:
        requestsPerMinute:
          type: integer
          minimum: 1
          maximum: 60000
        maxConcurrency:
          type: integer
          minimum: 1
          maximum: 1000
        timeoutSeconds:
          type: integer
          minimum: 1
          maximum: 120
        circuitBreaker:
          type: object
          additionalProperties: false
          minProperties: 1
          properties:
            failureThreshold:
              type: integer
              minimum: 2
              maximum: 100
            windowSeconds:
              type: integer
              minimum: 1
              maximum: 600
            cooldownSeconds:
              type: integer
              minimum: 1
              maximum: 3600
    CustomEndpoint:
      type: object
      additionalProperties: false
      required:
      - id
      - slug
      - publicSlug
      - name
      - description
      - method
      - path
      - inputSchema
      - inputExample
      - outputSchema
      - outputExample
      - providerCostUsdc
      - markupBps
      - flatMarkupUsdc
      - endUserPriceUsdc
      - enabled
      - pricingRevision
      - createdAt
      - updatedAt
      properties:
        id:
          type: string
          format: uuid
        slug:
          type: string
        publicSlug:
          type: string
          pattern: ^custom-[^/]+/[^/]+$
          description: Catalog and execution identity.
        name:
          type: string
        description:
          type: string
        method:
          type: string
          enum:
          - GET
          - POST
          - PUT
          - PATCH
          - DELETE
        path:
          type: string
        inputSchema:
          type: object
          additionalProperties: true
        inputExample:
          type: object
          additionalProperties: true
        outputSchema:
          oneOf:
          - type: object
            additionalProperties: true
          - type: 'null'
        outputExample: {}
        providerCostUsdc:
          $ref: '#/components/schemas/DecimalString'
        markupBps:
          type: integer
          minimum: 0
        flatMarkupUsdc:
          $ref: '#/components/schemas/DecimalString'
        endUserPriceUsdc:
          $ref: '#/components/schemas/DecimalString'
        enabled:
          type: boolean
        pricingRevision:
          type: integer
          minimum: 0
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    CustomEndpointUpdateRequest:
      type: object
      additionalProperties: false
      minProperties: 1
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 80
        description:
          type: string
          minLength: 1
          maxLength: 500
        method:
          type: string
          enum:
          - GET
          - POST
          - PUT
          - PATCH
          - DELETE
        path:
          type: string
          minLength: 1
          maxLength: 1024
        inputSchema:
          type: object
          additionalProperties: true
        inputExample:
          type: object
          additionalProperties: true
        outputSchema:
          oneOf:
          - type: object
            additionalProperties: true
          - type: 'null'
        outputExample: {}
        providerCostUsdc:
          oneOf:
          - $ref: '#/components/schemas/DecimalString'
          - type: number
            minimum: 0
        markupBps:
          type: integer
          minimum: 0
          maximum: 10000
        flatMarkupUsdc:
          oneOf:
          - $ref: '#/components/schemas/DecimalString'
          - type: number
            minimum: 0
        enabled:
          type: boolean
      description: Any non-empty subset of the create fields except slug. Unspecified fields remain unchanged; all affected contracts and prices are revalidated.
    CustomProviderCreateRequest:
      type: object
      additionalProperties: false
      required:
      - slug
      - name
      - baseUrl
      - auth
      properties:
        slug:
          type: string
          pattern: ^[a-z0-9][a-z0-9-]{1,62}[a-z0-9]$
          description: Stable provider name. The public catalog name is custom-{slug}.
        name:
          type: string
          minLength: 1
          maxLength: 80
        description:
          type: string
          maxLength: 500
        baseUrl:
          type: string
          format: uri
          maxLength: 2048
          description: HTTPS upstream origin validated against SSRF and private-network controls.
        auth:
          $ref: '#/components/schemas/CustomAuthInput'
        traffic:
          $ref: '#/components/schemas/CustomTrafficPolicy'
        endpoint:
          $ref: '#/components/schemas/CustomEndpointCreateRequest'
        endpoints:
          type: array
          minItems: 1
          maxItems: 50
          items:
            $ref: '#/components/schemas/CustomEndpointCreateRequest'
          description: Use endpoint or endpoints, never both. Slugs must be unique within the request.
    CustomTrafficPolicy:
      type: object
      additionalProperties: false
      required:
      - requestsPerMinute
      - maxConcurrency
      - timeoutSeconds
      - circuitBreaker
      properties:
        requestsPerMinute:
          type: integer
          minimum: 1
          maximum: 60000
          description: Must not exceed the platform-wide 60,000 request-per-minute ceiling.
        maxConcurrency:
          type: integer
          minimum: 1
          maximum: 1000
        timeoutSeconds:
          type: integer
          minimum: 1
          maximum: 120
        circuitBreaker:
          $ref: '#/components/schemas/CustomCircuitBreakerPolicy'
    CustomEndpointResponse:
      type: object
      additionalProperties: false
      required:
      - success
      - endpoint
      properties:
        success:
          const: true
        endpoint:
          $ref: '#/components/schemas/CustomEndpoint'
    CustomProviderUpdateRequest:
      type: object
      additionalProperties: false
      minProperties: 1
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 80
        description:
          type:
          - string
          - 'null'
          maxLength: 500
        baseUrl:
          type: string
          format: uri
          maxLength: 2048
        auth:
          $ref: '#/components/schemas/CustomAuthInput'
        traffic:
          $ref: '#/components/schemas/CustomTrafficPolicyUpdate'
    CustomProvider:
      type: object
      additionalProperties: false
      required:
      - id
      - slug
      - publicProvider
      - name
      - description
      - baseUrl
      - auth
      - traffic
      - endpoints
      - createdAt
      - updatedAt
      properties:
        id:
          type: string
          format: uuid
        slug:
          type: string
        publicProvider:
          type: string
          pattern: ^custom-
          description: Provider name used in catalog discovery and /wrapped/credits/{provider}/{endpoint}.
        name:
          type: string
        description:
          type:
          - string
          - 'null'
        baseUrl:
          type:
          - string
          - 'null'
          format: uri
          description: Null when upstream configuration is redacted for this caller.
        auth:
          $ref: '#/components/schemas/CustomAuthView'
        traffic:
          $ref: '#/components/schemas/CustomTrafficPolicy'
        endpoints:
          type: array
          items:
            $ref: '#/components/schemas/CustomEndpoint'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    CustomCircuitBreakerPolicy:
      type: object
      additionalProperties: false
      required:
      - failureThreshold
      - windowSeconds
      - cooldownSeconds
      properties:
        failureThreshold:
          type: integer
          minimum: 2
          maximum: 100
        windowSeconds:
          type: integer
          minimum: 1
          maximum: 600
        cooldownSeconds:
          type: integer
          minimum: 1
          maximum: 3600
    CustomEndpointCreateRequest:
      type: object
      additionalProperties: false
      required:
      - slug
      - name
      - description
      - method
      - path
      - inputSchema
      - inputExample
      - providerCostUsdc
      - markupBps
      - flatMarkupUsdc
      properties:
        slug:
          type: string
          pattern: ^[a-z0-9][a-z0-9-]{1,62}[a-z0-9]$
          description: Stable 3–64 character action name.
        name:
          type: string
          minLength: 1
          maxLength: 80
        description:
          type: string
          minLength: 1
          maxLength: 500
        method:
          type: string
          enum:
          - GET
          - POST
          - PUT
          - PATCH
          - DELETE
        path:
          type: string
          minLength: 1
          maxLength: 1024
          description: Upstream path. Placeholders must reference required scalar properties from inputSchema.
        inputSchema:
          type: object
          additionalProperties: true
          description: Compilable JSON Schema, at most 64 KiB and 32 levels deep, whose root type is object. Top-level transport-control names are reserved.
        inputExample:
          type: object
          additionalProperties: true
          description: Executable example that must satisfy inputSchema.
        outputSchema:
          oneOf:
          - type: object
            additionalProperties: true
          - type: 'null'
          description: Optional JSON Schema, at most 64 KiB and 32 levels deep.
        outputExample:
          description: Optional example that must satisfy outputSchema when both are provided.
        providerCostUsdc:
          oneOf:
          - $ref: '#/components/schemas/DecimalString'
          - type: number
            minimum: 0
          description: Upstream provider cost in USD, rounded up to six decimal places.
        markupBps:
          type: integer
          minimum: 0
          maximum: 10000
          description: Percentage markup, also limited by the workspace's effective cap.
        flatMarkupUsdc:
          oneOf:
          - $ref: '#/components/schemas/DecimalString'
          - type: number
            minimum: 0
          description: Flat USD markup, also limited by the workspace's effective cap.
        enabled:
          type: boolean
          default: false
          description: Enabled actions must have a positive end-user price.
    CustomAuthInput:
      type: object
      additionalProperties: false
      required:
      - type
      properties:
        type:
          type: string
          enum:
          - bearer
          - header
          - query
          - none
        name:
          type: string
          minLength: 1
          maxLength: 100
          description: Required for header and query authentication; must be a valid HTTP field name.
        prefix:
          type: string
          maxLength: 80
          description: Optional value prefix for header or query authentication. Bearer authentication always uses 'Bearer '.
        credential:
          type: string
          minLength: 1
          maxLength: 4096
          writeOnly: true
          description: Required when creating a bearer, header, or query provider. Omit during an update to retain the encrypted credential. Never returned.
      description: For type=none, omit credential. For type=header or type=query, supply name.
    CustomProviderListResponse:
      type: object
      additionalProperties: false
      required:
      - success
      - markupCapBps
      - providers
      properties:
        success:
          const: true
        markupCapBps:
          type: integer
          minimum: 0
          maximum: 10000
        providers:
          type: array
          items:
            $ref: '#/components/schemas/CustomProvider'
    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.
    CustomProviderResponse:
      type: object
      additionalProperties: false
      required:
      - success
      - provider
      properties:
        success:
          const: true
        provider:
          $ref: '#/components/schemas/CustomProvider'
    CustomAuthView:
      type: object
      additionalProperties: false
      required:
      - type
      - name
      - prefix
      - configured
      - hint
      - version
      - updatedAt
      properties:
        type:
          type:
          - string
          - 'null'
          enum:
          - bearer
          - header
          - query
          - none
          - null
          description: Null when upstream configuration is redacted for this caller.
        name:
          type:
          - string
          - 'null'
        prefix:
          type:
          - string
          - 'null'
        configured:
          type: boolean
        hint:
          type:
          - string
          - 'null'
          description: Non-secret credential hint for an authorized owner; never the credential itself.
        version:
          type: integer
          minimum: 0
        updatedAt:
          type:
          - string
          - 'null'
          format: date-time
  parameters:
    CustomEndpointId:
      name: endpointId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Workspace-owned custom action ID.
    CustomProviderId:
      name: providerId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Workspace-owned custom provider ID. This is distinct from its public custom-{slug} catalog name.
  responses:
    UnauthorizedManagement:
      description: Missing, invalid, expired, or revoked management credential
  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.