Pexafy Usage API

Quota counters. One resource group of the Pexafy Stock Photos API (the name the provider publishes in its apis.json and OpenAPI).

GitHub OpenAPI
Business capability
API Consumption Governance BC-4270.50

Operations 5

GET /api/v1/usage Current month usage #
GET /api/v1/usage/daily Daily usage history #
GET /api/v1/usage/monthly Monthly usage history #
GET /api/v1/usage/by-key Usage by API key #
GET /usage Quota counters for the current period #

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/pexafy:pexafy-usage-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

pexafy-usage-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Pexafy Stock Photos Usage API
  version: v1.0.0
  description: 'Semantic image search across free stock-photo libraries, among them Unsplash, Pexels and Pixabay, behind a single endpoint and a single response schema. The live list of sources is served by `GET /api/v1/facets/sources`.


    One Pexafy request replaces the 3 to 5 provider calls, the response normalisation and the de-duplication you would otherwise write and maintain yourself.


    ## What it does


    - **Natural-language search** — `a tired developer at a desk, warm lamp light` is ranked by meaning, not keyword overlap. Queries work in 100+ languages.

    - **Image-to-image search** — post an image, get visually similar ones.

    - **Filters** — colour (hex or name), orientation, licence, source, photographer, date.

    - **One schema** — every photo carries the same fields whatever the source: id, urls, dimensions, dominant colours, photographer, licence and the attribution string to display.


    ## Access


    - API key issued immediately at pexafy.com/dashboard/api-keys/create — no application review, no mandatory download-tracking callback.

    - A free plan is available, no credit card required. Plans and quotas: pexafy.com/pricing.

    - Also exposed as an MCP server at `https://mcp.pexafy.com/mcp` for LLM clients (details).'
  termsOfService: https://pexafy.com/legal/terms/
  contact:
    name: Pexafy Support
    url: https://pexafy.com/contact/
    email: support@pexafy.com
  license:
    name: Pexafy API Terms of Service
    url: https://pexafy.com/legal/terms/
  x-logo:
    url: https://pexafy.com/static/img/favicon.svg
    altText: Pexafy
servers:
- url: https://api.pexafy.com
  description: Production
tags:
- name: Usage
  description: Quota counters.
paths:
  /api/v1/usage:
    get:
      tags:
      - Usage
      summary: Current month usage
      description: 'See how many API requests you have made during the current billing month and how many you have left under your plan. Counters update in real time.


        The response contains the `period` (e.g. `2026-06`) and a `requests` object with `used`, `limit` and `remaining`.'
      operationId: get_usage_api_v1_usage_get
      parameters: []
      responses:
        '200':
          description: Usage counters for the current month.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageResponse'
              example:
                success: true
                data:
                  period: 2026-10
                  requests:
                    used: 3482
                    limit: 10000
                    remaining: 6518
                meta:
                  request_id: 6f3b86a4-e5ab-4ba1-9ee0-0b7cedd86009
                  took_ms: 2.76
                error: null
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - ApiKeyAuth: []
  /api/v1/usage/daily:
    get:
      tags:
      - Usage
      summary: Daily usage history
      description: Get your request count for each day over a recent window (up to the last 90 days), oldest day first. Useful for drawing a usage chart. Days older than 90 days are not kept.
      operationId: get_daily_usage_api_v1_usage_daily_get
      parameters:
      - name: days
        in: query
        required: false
        schema:
          type: integer
          maximum: 90
          minimum: 1
          description: How many days back to include, from 1 to 90. Defaults to 30.
          default: 30
          title: Days
        description: How many days back to include, from 1 to 90. Defaults to 30.
        example: 7
      responses:
        '200':
          description: List of daily usage records for the requested period.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DailyUsageResponse'
              example:
                success: true
                data:
                  period_days: 7
                  records:
                  - date: '2026-10-09'
                    requests: 1210
                  - date: '2026-10-14'
                    requests: 846
                meta:
                  request_id: 21e42972-1703-457b-a192-80d2f87d922f
                  took_ms: 3.41
                error: null
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - ApiKeyAuth: []
  /api/v1/usage/monthly:
    get:
      tags:
      - Usage
      summary: Monthly usage history
      description: Get your total request count for each month (up to the last 24), the most recent month first. Useful for tracking long-term usage and billing history.
      operationId: get_monthly_usage_api_v1_usage_monthly_get
      parameters:
      - name: months
        in: query
        required: false
        schema:
          type: integer
          maximum: 24
          minimum: 1
          description: How many months to include, from 1 to 24. Defaults to 12.
          default: 12
          title: Months
        description: How many months to include, from 1 to 24. Defaults to 12.
        example: 6
      responses:
        '200':
          description: List of monthly usage records.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MonthlyUsageResponse'
              example:
                success: true
                data:
                  period_months: 6
                  records:
                  - month: 2026-10
                    requests: 3482
                  - month: 2026-09
                    requests: 7915
                meta:
                  request_id: d407f3d0-2499-4fca-a354-46b7f41b38fe
                  took_ms: 2.95
                error: null
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - ApiKeyAuth: []
  /api/v1/usage/by-key:
    get:
      tags:
      - Usage
      summary: Usage by API key
      description: Break your usage down by individual API key — see this month's and today's request count for each active key. Handy for spotting which key (or which app) drives the most traffic.
      operationId: get_usage_by_key_api_v1_usage_by_key_get
      parameters: []
      responses:
        '200':
          description: List of API keys with their individual usage counters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageByKeyResponse'
              example:
                success: true
                data:
                  keys:
                  - key_id: 007BD937014346F18E37980984DD7254
                    name: default
                    created_at: '2026-09-04T10:03:17+00:00'
                    last_used_at: '2026-10-09T18:42:51+00:00'
                    requests_this_month: 1987
                    requests_today: 0
                  - key_id: DF056FA544D24B21955BBA90FE532A62
                    name: blog-illustrator
                    created_at: '2026-10-02T14:27:40+00:00'
                    last_used_at: '2026-10-14T16:05:09+00:00'
                    requests_this_month: 1495
                    requests_today: 846
                meta:
                  request_id: e2dd2976-fc40-4aed-960d-132acea88674
                  took_ms: 4.18
                error: null
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - ApiKeyAuth: []
  /usage:
    get:
      operationId: getUsage
      tags:
      - Usage
      summary: Quota counters for the current period
      description: Counters are updated on write and may lag a call or two behind under load. Do not use them to decide whether the next request will succeed; use the 429 and the Retry-After header.
      responses:
        '200':
          description: Current usage.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageEnvelope'
        '401':
          description: The API key is missing, malformed or revoked.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
              example:
                success: false
                error:
                  code: unauthenticated
                  message: The API key is missing, malformed or revoked.
                  request_id: req_01J8Z3
        '429':
          description: Too many requests, or the plan quota is exhausted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
              example:
                success: false
                error:
                  code: rate_limited
                  message: Too many requests, or the plan quota is exhausted.
                  request_id: req_01J8Z3
components:
  schemas:
    DailyUsageResponse:
      type: object
      properties:
        success:
          type: boolean
        data:
          type: object
          properties:
            period_days:
              type: integer
            records:
              type: array
              items:
                type: object
                properties:
                  date:
                    type: string
                  requests:
                    type: integer
        meta:
          $ref: '#/components/schemas/Meta'
        error:
          anyOf:
          - $ref: '#/components/schemas/ApiError'
          - type: 'null'
    ApiError:
      type: object
      properties:
        code:
          type: string
          description: Machine-readable error code (e.g. `MISSING_PARAMS`, `PHOTO_NOT_FOUND`).
        message:
          type: string
          description: Human-readable error message.
        request_id:
          type: string
      required:
      - code
      - message
    Meta:
      type: object
      properties:
        request_id:
          type: string
          description: Unique id for this request (quote it in support tickets).
        took_ms:
          type: number
          description: Server processing time in milliseconds.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    UsageByKeyResponse:
      type: object
      properties:
        success:
          type: boolean
        data:
          type: object
          properties:
            keys:
              type: array
              items:
                type: object
                properties:
                  key_id:
                    type: string
                  name:
                    type: string
                  created_at:
                    type:
                    - string
                    - 'null'
                    format: date-time
                  last_used_at:
                    type:
                    - string
                    - 'null'
                    format: date-time
                  requests_this_month:
                    type: integer
                  requests_today:
                    type: integer
        meta:
          $ref: '#/components/schemas/Meta'
        error:
          anyOf:
          - $ref: '#/components/schemas/ApiError'
          - type: 'null'
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    MonthlyUsageResponse:
      type: object
      properties:
        success:
          type: boolean
        data:
          type: object
          properties:
            period_months:
              type: integer
            records:
              type: array
              items:
                type: object
                properties:
                  month:
                    type: string
                    description: YYYY-MM
                  requests:
                    type: integer
        meta:
          $ref: '#/components/schemas/Meta'
        error:
          anyOf:
          - $ref: '#/components/schemas/ApiError'
          - type: 'null'
    UsageResponse:
      type: object
      properties:
        success:
          type: boolean
        data:
          type: object
          properties:
            period:
              type: string
              description: YYYY-MM
            requests:
              type: object
              properties:
                used:
                  type: integer
                limit:
                  type: integer
                remaining:
                  type: integer
        meta:
          $ref: '#/components/schemas/Meta'
        error:
          anyOf:
          - $ref: '#/components/schemas/ApiError'
          - type: 'null'
    Usage:
      type: object
      description: Quota counters for the calling key's account.
      properties:
        plan:
          type: string
        period_start:
          type: string
          format: date
        period_end:
          type: string
          format: date
        searches:
          type: integer
          minimum: 0
        searches_limit:
          type:
          - integer
          - 'null'
          minimum: 0
          description: Null on plans with no ceiling.
        downloads:
          type: integer
          minimum: 0
        downloads_limit:
          type:
          - integer
          - 'null'
          minimum: 0
      example:
        plan: starter
        searches: 4120
        searches_limit: 10000
    UsageEnvelope:
      type: object
      required:
      - success
      - data
      properties:
        success:
          type: boolean
        data:
          $ref: '#/components/schemas/Usage'
        meta:
          $ref: '#/components/schemas/Meta'
      example:
        success: true
        data:
          plan: starter
          searches: 4120
          searches_limit: 10000
    ErrorEnvelope:
      type: object
      required:
      - success
      - error
      description: Every failure uses this shape, whatever the status code.
      properties:
        success:
          type: boolean
          enum:
          - false
        error:
          type: object
          required:
          - code
          - message
          properties:
            code:
              type: string
              description: 'Machine readable and stable across versions. Branch on this, not on the message. The set is extensible: treat an unrecognised code as a generic failure of its status class.'
              example: validation_failed
            message:
              type: string
              description: Human readable, not stable.
            request_id:
              type: string
            field:
              type:
              - string
              - 'null'
              description: Which parameter was rejected, when the failure is about one.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: 'Pass your Pexafy API key in this header.


        Get your API key at [pexafy.com/dashboard/api-keys/create](https://pexafy.com/dashboard/api-keys/create/).'
    apiKey:
      type: http
      scheme: bearer
      description: Send the key as a bearer token. Keys carry scopes; a read scoped key gets a 403 on anything under /collections.