> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pikzels.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get request status

> Check if an async request is still running or done.



## OpenAPI

````yaml openapi.json GET /v2/requests/{request_id}/status
openapi: 3.0.3
info:
  title: Pikzels Public API
  version: v2
  description: >-
    Public REST API for external developers (v2). Synchronous processing for
    thumbnails/titles (waits for result) by default; send async: true to get a
    request_id, status_url and response_url at once, poll GET
    /v2/requests/:request_id/status until the status is COMPLETED, then fetch
    the result from GET /v2/requests/:request_id. Async for persona/style
    creation. Thumbnail output URLs stay available, and every request with its
    input and output is listed under Requests in the API dashboard. Personas and
    styles are persisted. Image inputs must be JPEG, PNG or WebP, at most 10 MB
    and 25 megapixels, and not animated; the whole request body is limited to 15
    MB. V2 assigns a request_id at request start, returns it on error responses,
    and also sends it as the X-Request-Id header. V2 error messages are safe
    public summaries; use error.code and request_id for programmatic handling
    and support. Requests that cannot be processed return GENERATION_REJECTED.
    Smart Balance recovery only charges when the configured top-up can cover the
    failed request. When Smart Balance recovery is blocked by a failed or unpaid
    auto top-up invoice, V2 returns SMART_BALANCE_PAYMENT_FAILED. Each account
    has a limit on requests in flight at once (GET requests are not counted; an
    async request counts from submit until it completes or fails); it starts at
    10 and grows with API top-ups in the last 28 days. A request beyond it is
    rejected immediately with TOO_MANY_REQUESTS and is not charged. Generated
    images carry embedded machine-readable AI-provenance metadata (EXIF and XMP,
    including the IPTC digital source type) identifying them as AI-generated.
servers:
  - url: https://api.pikzels.com
security: []
paths:
  /v2/requests/{request_id}/status:
    get:
      tags:
        - requests
      summary: Get a request's status
      description: >-
        Poll this after sending a request with async: true. While the request
        waits or runs it answers HTTP 202 with status IN_QUEUE or IN_PROGRESS;
        once it is done, HTTP 200 with status COMPLETED. A failed request is
        COMPLETED too and includes error; its charge is refunded. Then fetch the
        result from response_url. Works for synchronous requests as well, which
        are always COMPLETED. Another account's request_id returns NOT_FOUND.
        GET requests do not count against your concurrency limit.
      operationId: get_v2_requests_request_id_status
      parameters:
        - in: path
          name: request_id
          required: true
          schema:
            type: string
            description: >-
              The request_id a POST request returned (in its body or the
              X-Request-Id header)
          description: >-
            The request_id a POST request returned (in its body or the
            X-Request-Id header)
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    description: >-
                      Only when the request failed: { code, message }, the error
                      the request returns without async
                  request_id:
                    type: string
                  response_url:
                    type: string
                    description: 'Where the result is: GET /v2/requests/:request_id'
                    pattern: ^https://\S+$
                  status:
                    type: string
                    description: >-
                      IN_QUEUE: waiting to start (HTTP 202). IN_PROGRESS:
                      generating (HTTP 202). COMPLETED: done, successfully or
                      not (HTTP 200) Allowed values: "IN_QUEUE", "IN_PROGRESS",
                      "COMPLETED".
                    enum:
                      - IN_QUEUE
                      - IN_PROGRESS
                      - COMPLETED
                  status_url:
                    type: string
                    description: This endpoint for the request
                    pattern: ^https://\S+$
                additionalProperties: false
                required:
                  - request_id
                  - response_url
                  - status
                  - status_url
              example:
                request_id: 18b2ad5e-2a9e-4d3f-b9a8-9f2a1e0b1234
                status: COMPLETED
                status_url: >-
                  https://api.pikzels.com/v2/requests/18b2ad5e-2a9e-4d3f-b9a8-9f2a1e0b1234/status
                response_url: >-
                  https://api.pikzels.com/v2/requests/18b2ad5e-2a9e-4d3f-b9a8-9f2a1e0b1234
        '202':
          description: Still in queue or in progress. Poll again.
          content:
            application/json:
              schema:
                type: object
                properties:
                  request_id:
                    type: string
                  status:
                    type: string
                    enum:
                      - IN_QUEUE
                      - IN_PROGRESS
                    description: 'Allowed values: "IN_QUEUE", "IN_PROGRESS".'
                  status_url:
                    type: string
                    pattern: ^https://\S+$
                  response_url:
                    type: string
                    pattern: ^https://\S+$
                additionalProperties: false
                required:
                  - request_id
                  - status
                  - status_url
                  - response_url
              example:
                request_id: 18b2ad5e-2a9e-4d3f-b9a8-9f2a1e0b1234
                status: IN_PROGRESS
                status_url: >-
                  https://api.pikzels.com/v2/requests/18b2ad5e-2a9e-4d3f-b9a8-9f2a1e0b1234/status
                response_url: >-
                  https://api.pikzels.com/v2/requests/18b2ad5e-2a9e-4d3f-b9a8-9f2a1e0b1234
        '400':
          description: Error
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/ErrorResponse'
                  - $ref: '#/components/schemas/ValidationErrorResponse'
        '401':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '402':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: NOT_FOUND
                  message: The requested resource was not found.
                request_id: 7b9e2f6d-2b5f-4d79-8d6c-4a9c6e2b7890
        '409':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '413':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '499':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '504':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: bash
          label: cURL
          source: >-
            curl -X GET
            "https://api.pikzels.com/v2/requests/18b2ad5e-2a9e-4d3f-b9a8-9f2a1e0b1234/status"
            \
              -H "X-Api-Key: pkz_yourapikey"
        - lang: python
          label: Python
          source: >-
            import requests


            url =
            "https://api.pikzels.com/v2/requests/18b2ad5e-2a9e-4d3f-b9a8-9f2a1e0b1234/status"

            headers = {
                "X-Api-Key": "pkz_yourapikey",
            }

            response = requests.get(url, headers=headers)

            print(response.json())
        - lang: javascript
          label: JavaScript
          source: >-
            const url =
            "https://api.pikzels.com/v2/requests/18b2ad5e-2a9e-4d3f-b9a8-9f2a1e0b1234/status";


            const options = {
              method: "GET",
              headers: {
                "X-Api-Key": "pkz_yourapikey",
              },
            };


            const response = await fetch(url, options);

            const data = await response.json();

            console.log(data);
components:
  schemas:
    ErrorResponse:
      type: object
      additionalProperties: false
      required:
        - error
        - request_id
      properties:
        error:
          type: object
          additionalProperties: false
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - VALIDATION_ERROR
                - INVALID_IMAGE
                - INVALID_PERSONA
                - INVALID_STYLE
                - INVALID_AMOUNT
                - CONTENT_POLICY
                - CANNOT_DELETE_PROCESSING
                - SUPPORT_IMAGE_NOT_SUPPORTED
                - MODEL_UNAVAILABLE
                - PERSONA_NOT_SUPPORTED
                - STYLE_NOT_SUPPORTED
                - REQUEST_IN_PROGRESS
                - MISSING_API_KEY
                - INVALID_API_KEY_FORMAT
                - INVALID_API_KEY
                - API_KEY_INACTIVE
                - API_KEY_DELETED
                - INSUFFICIENT_CREDITS
                - SMART_BALANCE_PAYMENT_FAILED
                - API_ACCESS_NOT_ENABLED
                - ACCOUNT_SUSPENDED
                - BUILTIN_READ_ONLY
                - PERSONA_NOT_FOUND
                - STYLE_NOT_FOUND
                - NOT_FOUND
                - PERSONA_NOT_READY
                - STYLE_NOT_READY
                - NAME_RESERVED
                - NAME_ALREADY_EXISTS
                - CONFLICT
                - IMAGE_TOO_LARGE
                - GENERATION_REJECTED
                - TOO_MANY_REQUESTS
                - CANCELLED
                - GENERATION_FAILED
                - INTERNAL_ERROR
                - SERVICE_UNDER_MAINTENANCE
                - GENERATION_TIMEOUT
                - SCORING_TIMEOUT
                - TITLE_TIMEOUT
            message:
              type: string
        request_id:
          type: string
    ValidationErrorResponse:
      type: object
      additionalProperties: false
      required:
        - error
        - request_id
      properties:
        error:
          type: object
          additionalProperties: false
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - VALIDATION_ERROR
            message:
              type: string
            details:
              type: array
              items:
                type: object
                additionalProperties: false
                required:
                  - message
                properties:
                  field:
                    type: string
                  message:
                    type: string
        request_id:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
      description: 'Your Pikzels API key (prefix: pkz_)'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.