Picsart Text2Text API

The Text2Text API from Picsart — 1 operation(s) for text2text.

OpenAPI Specification

picsart-text2text-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  version: '1.0'
  title: Picsart GenAI Ads Text2Text API
  description: '[Official technical documentation portal](https://docs.picsart.io/)

    [Developer Guidelines](https://picsart.io/terms)

    '
servers:
- url: https://genai-api.picsart.io/v1
  description: Production
security:
- apiKey: []
tags:
- name: Text2Text
paths:
  /text2text/chat/completions:
    post:
      summary: Text2Text Completions
      operationId: genai-text2text-completions
      description: 'The *Text2Text Completion* service helps generate a text based on the text introduced as input by the user. It also takes the pain out of writing to give your social, marketing, and advertising copy a premium edge.

        '
      tags:
      - Text2Text
      requestBody:
        content:
          application/json:
            schema:
              allOf:
              - $ref: '#/components/schemas/Text2TextCompletionsParameters'
              - $ref: '#/components/schemas/Text2TextModels'
      responses:
        '200':
          $ref: '#/components/responses/Text2TextResponse'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '402':
          $ref: '#/components/responses/402'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '405':
          $ref: '#/components/responses/405'
        '413':
          $ref: '#/components/responses/413'
        '415':
          $ref: '#/components/responses/415'
        '429':
          $ref: '#/components/responses/429'
        '431':
          $ref: '#/components/responses/431'
        '500':
          $ref: '#/components/responses/500'
        '503':
          $ref: '#/components/responses/503'
components:
  responses:
    '500':
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      headers:
        X-Picsart-Correlation-Id:
          schema:
            type: string
          description: The id which will help for troubleshooting request chain in the system.
        X-Picsart-Ratelimit-Available:
          schema:
            type: integer
          description: The number of available calls within the timeframe. See the X-Picsart-Ratelimit-Reset-Time.
        X-Picsart-Ratelimit-Limit:
          schema:
            type: integer
          description: The total number of requests that can be done within the timeframe. See the X-Picsart-Ratelimit-Reset-Time.
        X-Picsart-Ratelimit-Reset-Time:
          schema:
            type: integer
          description: The time when the used request count resets and the number of available calls gets equal to the total number.
        X-Picsart-Credit-Available:
          schema:
            type: integer
          description: The remaining number of the credits on the balance.
    '429':
      description: Too Many Requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      headers:
        X-Picsart-Correlation-Id:
          schema:
            type: string
          description: The id which will help for troubleshooting request chain in the system.
        X-Picsart-Ratelimit-Available:
          schema:
            type: integer
          description: The number of available calls within the timeframe. See the X-Picsart-Ratelimit-Reset-Time.
        X-Picsart-Ratelimit-Limit:
          schema:
            type: integer
          description: The total number of requests that can be done within the timeframe. See the X-Picsart-Ratelimit-Reset-Time.
        X-Picsart-Ratelimit-Reset-Time:
          schema:
            type: integer
          description: The time when the used request count resets and the number of available calls gets equal to the total number.
        X-Picsart-Credit-Available:
          schema:
            type: integer
          description: The remaining number of the credits on the balance.
    '431':
      description: Request Header Fields Too Large
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      headers:
        X-Picsart-Correlation-Id:
          schema:
            type: string
          description: The id which will help for troubleshooting request chain in the system.
        X-Picsart-Ratelimit-Available:
          schema:
            type: integer
          description: The number of available calls within the timeframe. See the X-Picsart-Ratelimit-Reset-Time.
        X-Picsart-Ratelimit-Limit:
          schema:
            type: integer
          description: The total number of requests that can be done within the timeframe. See the X-Picsart-Ratelimit-Reset-Time.
        X-Picsart-Ratelimit-Reset-Time:
          schema:
            type: integer
          description: The time when the used request count resets and the number of available calls gets equal to the total number.
        X-Picsart-Credit-Available:
          schema:
            type: integer
          description: The remaining number of the credits on the balance.
    '413':
      description: Request Entity Too Large
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      headers:
        X-Picsart-Correlation-Id:
          schema:
            type: string
          description: The id which will help for troubleshooting request chain in the system.
        X-Picsart-Ratelimit-Available:
          schema:
            type: integer
          description: The number of available calls within the timeframe. See the X-Picsart-Ratelimit-Reset-Time.
        X-Picsart-Ratelimit-Limit:
          schema:
            type: integer
          description: The total number of requests that can be done within the timeframe. See the X-Picsart-Ratelimit-Reset-Time.
        X-Picsart-Ratelimit-Reset-Time:
          schema:
            type: integer
          description: The time when the used request count resets and the number of available calls gets equal to the total number.
        X-Picsart-Credit-Available:
          schema:
            type: integer
          description: The remaining number of the credits on the balance.
    '404':
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      headers:
        X-Picsart-Correlation-Id:
          schema:
            type: string
          description: The id which will help for troubleshooting request chain in the system.
        X-Picsart-Ratelimit-Available:
          schema:
            type: integer
          description: The number of available calls within the timeframe. See the X-Picsart-Ratelimit-Reset-Time.
        X-Picsart-Ratelimit-Limit:
          schema:
            type: integer
          description: The total number of requests that can be done within the timeframe. See the X-Picsart-Ratelimit-Reset-Time.
        X-Picsart-Ratelimit-Reset-Time:
          schema:
            type: integer
          description: The time when the used request count resets and the number of available calls gets equal to the total number.
        X-Picsart-Credit-Available:
          schema:
            type: integer
          description: The remaining number of the credits on the balance.
    '403':
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      headers:
        X-Picsart-Correlation-Id:
          schema:
            type: string
          description: The id which will help for troubleshooting request chain in the system.
        X-Picsart-Ratelimit-Available:
          schema:
            type: integer
          description: The number of available calls within the timeframe. See the X-Picsart-Ratelimit-Reset-Time.
        X-Picsart-Ratelimit-Limit:
          schema:
            type: integer
          description: The total number of requests that can be done within the timeframe. See the X-Picsart-Ratelimit-Reset-Time.
        X-Picsart-Ratelimit-Reset-Time:
          schema:
            type: integer
          description: The time when the used request count resets and the number of available calls gets equal to the total number.
        X-Picsart-Credit-Available:
          schema:
            type: integer
          description: The remaining number of the credits on the balance.
    '405':
      description: Method Not Allowed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      headers:
        X-Picsart-Correlation-Id:
          schema:
            type: string
          description: The id which will help for troubleshooting request chain in the system.
        X-Picsart-Ratelimit-Available:
          schema:
            type: integer
          description: The number of available calls within the timeframe. See the X-Picsart-Ratelimit-Reset-Time.
        X-Picsart-Ratelimit-Limit:
          schema:
            type: integer
          description: The total number of requests that can be done within the timeframe. See the X-Picsart-Ratelimit-Reset-Time.
        X-Picsart-Ratelimit-Reset-Time:
          schema:
            type: integer
          description: The time when the used request count resets and the number of available calls gets equal to the total number.
        X-Picsart-Credit-Available:
          schema:
            type: integer
          description: The remaining number of the credits on the balance.
    '401':
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      headers:
        X-Picsart-Correlation-Id:
          schema:
            type: string
          description: The id which will help for troubleshooting request chain in the system.
        X-Picsart-Ratelimit-Available:
          schema:
            type: integer
          description: The number of available calls within the timeframe. See the X-Picsart-Ratelimit-Reset-Time.
        X-Picsart-Ratelimit-Limit:
          schema:
            type: integer
          description: The total number of requests that can be done within the timeframe. See the X-Picsart-Ratelimit-Reset-Time.
        X-Picsart-Ratelimit-Reset-Time:
          schema:
            type: integer
          description: The time when the used request count resets and the number of available calls gets equal to the total number.
        X-Picsart-Credit-Available:
          schema:
            type: integer
          description: The remaining number of the credits on the balance.
    '400':
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      headers:
        X-Picsart-Correlation-Id:
          schema:
            type: string
          description: The id which will help for troubleshooting request chain in the system.
        X-Picsart-Ratelimit-Available:
          schema:
            type: integer
          description: The number of available calls within the timeframe. See the X-Picsart-Ratelimit-Reset-Time.
        X-Picsart-Ratelimit-Limit:
          schema:
            type: integer
          description: The total number of requests that can be done within the timeframe. See the X-Picsart-Ratelimit-Reset-Time.
        X-Picsart-Ratelimit-Reset-Time:
          schema:
            type: integer
          description: The time when the used request count resets and the number of available calls gets equal to the total number.
        X-Picsart-Credit-Available:
          schema:
            type: integer
          description: The remaining number of the credits on the balance.
    '415':
      description: Unsupported Media Type
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      headers:
        X-Picsart-Correlation-Id:
          schema:
            type: string
          description: The id which will help for troubleshooting request chain in the system.
        X-Picsart-Ratelimit-Available:
          schema:
            type: integer
          description: The number of available calls within the timeframe. See the X-Picsart-Ratelimit-Reset-Time.
        X-Picsart-Ratelimit-Limit:
          schema:
            type: integer
          description: The total number of requests that can be done within the timeframe. See the X-Picsart-Ratelimit-Reset-Time.
        X-Picsart-Ratelimit-Reset-Time:
          schema:
            type: integer
          description: The time when the used request count resets and the number of available calls gets equal to the total number.
        X-Picsart-Credit-Available:
          schema:
            type: integer
          description: The remaining number of the credits on the balance.
    '503':
      description: Service Unavailable
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      headers:
        X-Picsart-Correlation-Id:
          schema:
            type: string
          description: The id which will help for troubleshooting request chain in the system.
        X-Picsart-Ratelimit-Available:
          schema:
            type: integer
          description: The number of available calls within the timeframe. See the X-Picsart-Ratelimit-Reset-Time.
        X-Picsart-Ratelimit-Limit:
          schema:
            type: integer
          description: The total number of requests that can be done within the timeframe. See the X-Picsart-Ratelimit-Reset-Time.
        X-Picsart-Ratelimit-Reset-Time:
          schema:
            type: integer
          description: The time when the used request count resets and the number of available calls gets equal to the total number.
        X-Picsart-Credit-Available:
          schema:
            type: integer
          description: The remaining number of the credits on the balance.
    Text2TextResponse:
      description: Success.
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                nullable: false
              data:
                type: string
                description: The response to the provided messages/instructions.
                nullable: false
      headers:
        X-Picsart-Correlation-Id:
          schema:
            type: string
          description: The id which will help for troubleshooting request chain in the system.
        X-Picsart-Ratelimit-Available:
          schema:
            type: integer
          description: The number of available calls within the timeframe. See the X-Picsart-Ratelimit-Reset-Time.
        X-Picsart-Ratelimit-Limit:
          schema:
            type: integer
          description: The total number of requests that can be done within the timeframe. See the X-Picsart-Ratelimit-Reset-Time.
        X-Picsart-Ratelimit-Reset-Time:
          schema:
            type: integer
          description: The time when the used request count resets and the number of available calls gets equal to the total number.
        X-Picsart-Credit-Available:
          schema:
            type: integer
          description: The remaining number of the credits on the balance.
    '402':
      description: Payment Required
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      headers:
        X-Picsart-Correlation-Id:
          schema:
            type: string
          description: The id which will help for troubleshooting request chain in the system.
        X-Picsart-Ratelimit-Available:
          schema:
            type: integer
          description: The number of available calls within the timeframe. See the X-Picsart-Ratelimit-Reset-Time.
        X-Picsart-Ratelimit-Limit:
          schema:
            type: integer
          description: The total number of requests that can be done within the timeframe. See the X-Picsart-Ratelimit-Reset-Time.
        X-Picsart-Ratelimit-Reset-Time:
          schema:
            type: integer
          description: The time when the used request count resets and the number of available calls gets equal to the total number.
        X-Picsart-Credit-Available:
          schema:
            type: integer
          description: The remaining number of the credits on the balance.
  schemas:
    Text2TextModels:
      type: object
      properties:
        model:
          type: string
          enum:
          - urn:air:openai:model:openai:gpt-5@1
          - urn:air:openai:model:openai:gpt-5-search-api@1
          - urn:air:openai:model:openai:gpt-5.1@1
          - urn:air:openai:model:openai:gpt-5.1-chat@1
          - urn:air:openai:model:openai:gpt-5.2@1
          - urn:air:openai:model:openai:gpt-5-mini@1
          - urn:air:openai:model:openai:gpt-5-nano@1
          - urn:air:openai:model:openai:gpt-4o@1
          - urn:air:openai:model:openai:gpt-4o-mini@1
          - urn:air:openai:model:openai:gpt-4o-search-preview@1
          - urn:air:openai:model:openai:gpt-4-turbo@1
          - urn:air:openai:model:openai:gpt-4.1@1
          - urn:air:openai:model:openai:gpt-4.1-mini@1
          - urn:air:openai:model:openai:gpt-4.1-nano@1
          - urn:air:openai:model:openai:gpt-3.5-turbo@1
          - urn:air:anthropic:model:anthropic:claude-sonnet-4-5-latest@1
          - urn:air:anthropic:model:anthropic:claude-sonnet-4-6@1
          - urn:air:google:model:google:gemini-2.0-flash-001@1
          - urn:air:google:model:google:gemini-2.0-flash-lite@1
          - urn:air:google:model:google:gemini-2.5-pro@1
          - urn:air:google:model:google:gemini-2.5-flash@1
          - urn:air:google:model:google:gemini-3-pro-preview@1
          nullable: true
          default: urn:air:openai:model:openai:gpt-4o-mini@1
          description: 'Optionally choose a specific AI model to use for this request.

            If not specified, a default model will be applied. Please note that the default model may change over time as Picsart continues to improve performance and accuracy. Any change to the default will be made only after thorough testing and validation to ensure it delivers better results.

            If you require consistent behavior or wish to evaluate different models on your own, we recommend explicitly setting this parameter.

            '
    Error:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
        detail:
          type: string
      required:
      - detail
    Text2TextCompletionsParameters:
      required:
      - messages
      type: object
      properties:
        messages:
          type: array
          description: The messages containing the original text and instructions.
          items:
            type: object
            properties:
              role:
                type: string
                description: 'Each message object has a role (either system, user, or assistant) and content.

                  The system message is optional and can be used to set the behavior of the assistant The user messages provide requests or comments for the assistant to respond to Assistant messages store previous assistant responses, but can also be written by you to give examples of desired behavior.

                  '
              content:
                type: string
        max_tokens:
          type: number
          default: 512
        temperature:
          type: number
          default: 1
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-Picsart-API-Key