openapi: 3.0.0
servers:
  - url: https://prod.api.market/api/v1/swift-api/gpt-5
info:
  title: GPT-5
  description: GPT-5 is OpenAI flagship model for coding, reasoning, and agentic
    tasks across domains
  version: 1.1.0
paths:
  /chat/completions:
    post:
      summary: Creates a model response for the given chat conversation
      description: Given a list of messages comprising a conversation, the model will
        return a response with content filters and usage metadata.
      operationId: extractData
      requestBody:
        description: The input message and model configuration to process.
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                  description: The AI model to use for processing.
                  example: gpt-5
                stream:
                  type: boolean
                  description: Whether to stream responses as they are generated.
                  example: false
                messages:
                  type: array
                  description: List of input messages to process.
                  items:
                    type: object
                    properties:
                      role:
                        type: string
                        description: The role of the message sender.
                        enum:
                          - user
                          - system
                          - assistant
                        example: user
                      content:
                        type: string
                        description: The content of the message.
                        example: There are ten birds in a tree. A hunter shoots one. How many are left
                          in the tree?
              required:
                - model
                - messages
      responses:
        "200":
          description: Successful response containing the processed output.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    example: chatcmpl-CFJWVPlCose16sy2GzKWGeowqva9s
                  object:
                    type: string
                    example: chat.completion
                  created:
                    type: integer
                    example: 1757766003
                  model:
                    type: string
                    example: gpt-5
                  system_fingerprint:
                    type: string
                    example: fp_4f3d32ad4e
                  choices:
                    type: array
                    items:
                      type: object
                      properties:
                        index:
                          type: integer
                          example: 0
                        finish_reason:
                          type: string
                          example: stop
                        logprobs:
                          type: string
                          nullable: true
                          example: null
                        content_filter_results:
                          type: object
                          properties:
                            hate:
                              type: object
                              properties:
                                filtered:
                                  type: boolean
                                  example: false
                                severity:
                                  type: string
                                  example: safe
                            self_harm:
                              type: object
                              properties:
                                filtered:
                                  type: boolean
                                  example: false
                                severity:
                                  type: string
                                  example: safe
                            sexual:
                              type: object
                              properties:
                                filtered:
                                  type: boolean
                                  example: false
                                severity:
                                  type: string
                                  example: safe
                            violence:
                              type: object
                              properties:
                                filtered:
                                  type: boolean
                                  example: false
                                severity:
                                  type: string
                                  example: safe
                        message:
                          type: object
                          properties:
                            role:
                              type: string
                              example: assistant
                            content:
                              type: string
                              example: If a hunter shoots one bird, the noise would likely scare the other
                                birds away. So, even though one bird is shot,
                                the rest would typically fly off, leaving **0
                                birds** in the tree.
                            refusal:
                              type: string
                              nullable: true
                              example: null
                            annotations:
                              type: array
                              items: {}
                              example: []
                  prompt_filter_results:
                    type: array
                    items:
                      type: object
                      properties:
                        prompt_index:
                          type: integer
                          example: 0
                        content_filter_results:
                          type: object
                          properties:
                            hate:
                              type: object
                              properties:
                                filtered:
                                  type: boolean
                                  example: false
                                severity:
                                  type: string
                                  example: safe
                            self_harm:
                              type: object
                              properties:
                                filtered:
                                  type: boolean
                                  example: false
                                severity:
                                  type: string
                                  example: safe
                            sexual:
                              type: object
                              properties:
                                filtered:
                                  type: boolean
                                  example: false
                                severity:
                                  type: string
                                  example: safe
                            violence:
                              type: object
                              properties:
                                filtered:
                                  type: boolean
                                  example: false
                                severity:
                                  type: string
                                  example: safe
                            jailbreak:
                              type: object
                              properties:
                                filtered:
                                  type: boolean
                                  example: false
                                detected:
                                  type: boolean
                                  example: false
                  usage:
                    type: object
                    properties:
                      prompt_tokens:
                        type: integer
                        example: 28
                      completion_tokens:
                        type: integer
                        example: 43
                      total_tokens:
                        type: integer
                        example: 71
                      prompt_tokens_details:
                        type: object
                        properties:
                          audio_tokens:
                            type: integer
                            example: 0
                          cached_tokens:
                            type: integer
                            example: 0
                      completion_tokens_details:
                        type: object
                        properties:
                          audio_tokens:
                            type: integer
                            example: 0
                          reasoning_tokens:
                            type: integer
                            example: 0
                          accepted_prediction_tokens:
                            type: integer
                            example: 0
                          rejected_prediction_tokens:
                            type: integer
                            example: 0
        "400":
          description: Invalid input data or request format.
        "500":
          description: Internal server error.
    parameters:
      - description: API.market API Key
        in: header
        name: x-api-market-key
        value: Please Login/Signup to get an API Key
        required: true
        schema:
          type: string
security: {}
tags:
  - name: artificial-intelligence
    description: Operations related to artificial-intelligence
  - name: dev-tools
    description: Operations related to dev-tools
