OpenAI Completions API

Given a prompt, the model will return one or more predicted completions, and can also return the probabilities of alternative tokens at each position.

Operations 1

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

POST /completions Generate a text completion for a prompt · Creates a completion for the provided prompt and parameters. #
Ask an LLM
“How do I get a model to continue a piece of text with the legacy completions endpoint?”
“Can I stream completion tokens back as they're generated?”
Tell an agent
Complete the prompt {prompt} using {model}.
Complete {prompt} with {model}, at most {max_tokens} tokens and temperature {temperature}.

Documentation

📖
Documentation
https://platform.openai.com/docs/assistants/overview
📖
Documentation
https://platform.openai.com/docs/api-reference/assistants
📖
Documentation
https://platform.openai.com/docs/guides/text-to-speech
📖
Documentation
https://platform.openai.com/docs/api-reference/audio
📖
Documentation
https://platform.openai.com/docs/guides/speech-to-text
📖
Documentation
https://developers.openai.com/api/docs/guides/audio/
📖
Documentation
https://developers.openai.com/api/docs/guides/voice-agents/
📖
Documentation
https://platform.openai.com/docs/api-reference/chat
📖
Documentation
https://platform.openai.com/docs/guides/embeddings
📖
Documentation
https://platform.openai.com/docs/api-reference/embeddings
📖
Documentation
https://platform.openai.com/docs/api-reference/files
📖
Documentation
https://platform.openai.com/docs/guides/fine-tuning
📖
Documentation
https://platform.openai.com/docs/api-reference/fine-tuning
📖
Documentation
https://platform.openai.com/docs/guides/images
📖
Documentation
https://platform.openai.com/docs/api-reference/images
📖
Documentation
https://platform.openai.com/docs/guides/image-generation
📖
Documentation
https://platform.openai.com/docs/guides/images-vision
📖
Documentation
https://platform.openai.com/docs/models
📖
Documentation
https://platform.openai.com/docs/api-reference/models
📖
Documentation
https://platform.openai.com/docs/assistants/how-it-works/managing-threads-and-messages
📖
Documentation
https://platform.openai.com/docs/api-reference/threads
📖
Documentation
https://platform.openai.com/docs/api-reference/completions

Specifications

Schemas & Data

Other Resources

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/openai-completions-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

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. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

openai-completions-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: OpenAI Completions API
  description: The OpenAI REST API. Please see https://platform.openai.com/docs/api-reference for more details.
  version: 2.3.0
  termsOfService: https://openai.com/policies/terms-of-use
  contact:
    name: OpenAI Support
    url: https://help.openai.com/
  license:
    name: MIT
    url: https://github.com/openai/openai-openapi/blob/master/LICENSE
servers:
- url: https://api.openai.com/v1
security:
- ApiKeyAuth: []
tags:
- name: Completions
  description: Given a prompt, the model will return one or more predicted completions, and can also return the probabilities of alternative tokens at each position.
paths:
  /completions:
    post:
      operationId: createCompletion
      tags:
      - Completions
      summary: Creates a completion for the provided prompt and parameters.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCompletionRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateCompletionResponse'
      x-oaiMeta:
        name: Create completion
        group: completions
        legacy: true
        examples:
        - title: No streaming
          request:
            curl: "curl https://api.openai.com/v1/completions \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -d '{\n    \"model\": \"VAR_completion_model_id\",\n    \"prompt\": \"Say this is a test\",\n    \"max_tokens\": 7,\n    \"temperature\": 0\n  }'\n"
            python: "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n    api_key=os.environ.get(\"OPENAI_API_KEY\"),  # This is the default and can be omitted\n)\nfor completion in client.completions.create(\n    model=\"gpt-3.5-turbo-instruct\",\n    prompt=\"This is a test.\",\n):\n  print(completion)"
            javascript: "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const completion = await openai.completions.create({\n    model: \"VAR_completion_model_id\",\n    prompt: \"Say this is a test.\",\n    max_tokens: 7,\n    temperature: 0,\n  });\n\n  console.log(completion);\n}\nmain();"
            node.js: "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n  apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst completion = await client.completions.create({\n  model: 'gpt-3.5-turbo-instruct',\n  prompt: 'This is a test.',\n});\n\nconsole.log(completion);"
            go: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tcompletion, err := client.Completions.New(context.TODO(), openai.CompletionNewParams{\n\t\tModel: openai.CompletionNewParamsModelGPT3_5TurboInstruct,\n\t\tPrompt: openai.CompletionNewParamsPromptUnion{\n\t\t\tOfString: openai.String(\"This is a test.\"),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", completion)\n}\n"
            java: "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.completions.Completion;\nimport com.openai.models.completions.CompletionCreateParams;\n\npublic final class Main {\n    private Main() {}\n\n    public static void main(String[] args) {\n        OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n        CompletionCreateParams params = CompletionCreateParams.builder()\n            .model(CompletionCreateParams.Model.GPT_3_5_TURBO_INSTRUCT)\n            .prompt(\"This is a test.\")\n            .build();\n        Completion completion = client.completions().create(params);\n    }\n}"
            ruby: 'require "openai"


              openai = OpenAI::Client.new(api_key: "My API Key")


              completion = openai.completions.create(model: :"gpt-3.5-turbo-instruct", prompt: "This is a test.")


              puts(completion)'
          response: "{\n  \"id\": \"cmpl-uqkvlQyYK7bGYrRHQ0eXlWi7\",\n  \"object\": \"text_completion\",\n  \"created\": 1589478378,\n  \"model\": \"VAR_completion_model_id\",\n  \"system_fingerprint\": \"fp_44709d6fcb\",\n  \"choices\": [\n    {\n      \"text\": \"\\n\\nThis is indeed a test\",\n      \"index\": 0,\n      \"logprobs\": null,\n      \"finish_reason\": \"length\"\n    }\n  ],\n  \"usage\": {\n    \"prompt_tokens\": 5,\n    \"completion_tokens\": 7,\n    \"total_tokens\": 12\n  }\n}\n"
        - title: Streaming
          request:
            curl: "curl https://api.openai.com/v1/completions \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -d '{\n    \"model\": \"VAR_completion_model_id\",\n    \"prompt\": \"Say this is a test\",\n    \"max_tokens\": 7,\n    \"temperature\": 0,\n    \"stream\": true\n  }'\n"
            python: "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n    api_key=os.environ.get(\"OPENAI_API_KEY\"),  # This is the default and can be omitted\n)\nfor completion in client.completions.create(\n    model=\"gpt-3.5-turbo-instruct\",\n    prompt=\"This is a test.\",\n):\n  print(completion)"
            javascript: "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const stream = await openai.completions.create({\n    model: \"VAR_completion_model_id\",\n    prompt: \"Say this is a test.\",\n    stream: true,\n  });\n\n  for await (const chunk of stream) {\n    console.log(chunk.choices[0].text)\n  }\n}\nmain();"
            node.js: "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n  apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst completion = await client.completions.create({\n  model: 'gpt-3.5-turbo-instruct',\n  prompt: 'This is a test.',\n});\n\nconsole.log(completion);"
            go: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tcompletion, err := client.Completions.New(context.TODO(), openai.CompletionNewParams{\n\t\tModel: openai.CompletionNewParamsModelGPT3_5TurboInstruct,\n\t\tPrompt: openai.CompletionNewParamsPromptUnion{\n\t\t\tOfString: openai.String(\"This is a test.\"),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", completion)\n}\n"
            java: "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.completions.Completion;\nimport com.openai.models.completions.CompletionCreateParams;\n\npublic final class Main {\n    private Main() {}\n\n    public static void main(String[] args) {\n        OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n        CompletionCreateParams params = CompletionCreateParams.builder()\n            .model(CompletionCreateParams.Model.GPT_3_5_TURBO_INSTRUCT)\n            .prompt(\"This is a test.\")\n            .build();\n        Completion completion = client.completions().create(params);\n    }\n}"
            ruby: 'require "openai"


              openai = OpenAI::Client.new(api_key: "My API Key")


              completion = openai.completions.create(model: :"gpt-3.5-turbo-instruct", prompt: "This is a test.")


              puts(completion)'
          response: "{\n  \"id\": \"cmpl-7iA7iJjj8V2zOkCGvWF2hAkDWBQZe\",\n  \"object\": \"text_completion\",\n  \"created\": 1690759702,\n  \"choices\": [\n    {\n      \"text\": \"This\",\n      \"index\": 0,\n      \"logprobs\": null,\n      \"finish_reason\": null\n    }\n  ],\n  \"model\": \"gpt-3.5-turbo-instruct\"\n  \"system_fingerprint\": \"fp_44709d6fcb\",\n}\n"
components:
  schemas:
    CreateCompletionRequest:
      type: object
      properties:
        model:
          description: 'ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them.

            '
          anyOf:
          - type: string
          - type: string
            enum:
            - gpt-3.5-turbo-instruct
            - davinci-002
            - babbage-002
          x-oaiTypeLabel: string
        prompt:
          description: 'The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays.


            Note that <|endoftext|> is the document separator that the model sees during training, so if a prompt is not specified the model will generate as if from the beginning of a new document.

            '
          default: <|endoftext|>
          nullable: true
          oneOf:
          - type: string
            default: ''
            example: This is a test.
          - type: array
            items:
              type: string
              default: ''
              example: This is a test.
          - type: array
            minItems: 1
            items:
              type: integer
            example: '[1212, 318, 257, 1332, 13]'
          - type: array
            minItems: 1
            items:
              type: array
              minItems: 1
              items:
                type: integer
            example: '[[1212, 318, 257, 1332, 13]]'
        best_of:
          type: integer
          default: 1
          minimum: 0
          maximum: 20
          nullable: true
          description: 'Generates `best_of` completions server-side and returns the "best" (the one with the highest log probability per token). Results cannot be streamed.


            When used with `n`, `best_of` controls the number of candidate completions and `n` specifies how many to return – `best_of` must be greater than `n`.


            **Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`.

            '
        echo:
          type: boolean
          default: false
          nullable: true
          description: 'Echo back the prompt in addition to the completion

            '
        frequency_penalty:
          type: number
          default: 0
          minimum: -2
          maximum: 2
          nullable: true
          description: 'Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model''s likelihood to repeat the same line verbatim.


            [See more information about frequency and presence penalties.](/docs/guides/text-generation)

            '
        logit_bias:
          type: object
          x-oaiTypeLabel: map
          default: null
          nullable: true
          additionalProperties:
            type: integer
          description: 'Modify the likelihood of specified tokens appearing in the completion.


            Accepts a JSON object that maps tokens (specified by their token ID in the GPT tokenizer) to an associated bias value from -100 to 100. You can use this [tokenizer tool](/tokenizer?view=bpe) to convert text to token IDs. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token.


            As an example, you can pass `{"50256": -100}` to prevent the <|endoftext|> token from being generated.

            '
        logprobs:
          type: integer
          minimum: 0
          maximum: 5
          default: null
          nullable: true
          description: 'Include the log probabilities on the `logprobs` most likely output tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response.


            The maximum value for `logprobs` is 5.

            '
        max_tokens:
          type: integer
          minimum: 0
          default: 16
          example: 16
          nullable: true
          description: 'The maximum number of [tokens](/tokenizer) that can be generated in the completion.


            The token count of your prompt plus `max_tokens` cannot exceed the model''s context length. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens.

            '
        n:
          type: integer
          minimum: 1
          maximum: 128
          default: 1
          example: 1
          nullable: true
          description: 'How many completions to generate for each prompt.


            **Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`.

            '
        presence_penalty:
          type: number
          default: 0
          minimum: -2
          maximum: 2
          nullable: true
          description: 'Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model''s likelihood to talk about new topics.


            [See more information about frequency and presence penalties.](/docs/guides/text-generation)

            '
        seed:
          type: integer
          format: int64
          nullable: true
          description: 'If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result.


            Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend.

            '
        stop:
          $ref: '#/components/schemas/StopConfiguration'
        stream:
          description: 'Whether to stream back partial progress. If set, tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions).

            '
          type: boolean
          nullable: true
          default: false
        stream_options:
          $ref: '#/components/schemas/ChatCompletionStreamOptions'
        suffix:
          description: 'The suffix that comes after a completion of inserted text.


            This parameter is only supported for `gpt-3.5-turbo-instruct`.

            '
          default: null
          nullable: true
          type: string
          example: test.
        temperature:
          type: number
          minimum: 0
          maximum: 2
          default: 1
          example: 1
          nullable: true
          description: 'What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.


            We generally recommend altering this or `top_p` but not both.

            '
        top_p:
          type: number
          minimum: 0
          maximum: 1
          default: 1
          example: 1
          nullable: true
          description: 'An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.


            We generally recommend altering this or `temperature` but not both.

            '
        user:
          type: string
          example: user-1234
          description: 'A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices#end-user-ids).

            '
      required:
      - model
      - prompt
    CompletionUsage:
      type: object
      description: Usage statistics for the completion request.
      properties:
        completion_tokens:
          type: integer
          default: 0
          description: Number of tokens in the generated completion.
        prompt_tokens:
          type: integer
          default: 0
          description: Number of tokens in the prompt.
        total_tokens:
          type: integer
          default: 0
          description: Total number of tokens used in the request (prompt + completion).
        completion_tokens_details:
          type: object
          description: Breakdown of tokens used in a completion.
          properties:
            accepted_prediction_tokens:
              type: integer
              default: 0
              description: 'When using Predicted Outputs, the number of tokens in the

                prediction that appeared in the completion.

                '
            audio_tokens:
              type: integer
              default: 0
              description: Audio input tokens generated by the model.
            reasoning_tokens:
              type: integer
              default: 0
              description: Tokens generated by the model for reasoning.
            rejected_prediction_tokens:
              type: integer
              default: 0
              description: 'When using Predicted Outputs, the number of tokens in the

                prediction that did not appear in the completion. However, like

                reasoning tokens, these tokens are still counted in the total

                completion tokens for purposes of billing, output, and context window

                limits.

                '
        prompt_tokens_details:
          type: object
          description: Breakdown of tokens used in the prompt.
          properties:
            audio_tokens:
              type: integer
              default: 0
              description: Audio input tokens present in the prompt.
            cached_tokens:
              type: integer
              default: 0
              description: Cached tokens present in the prompt.
      required:
      - prompt_tokens
      - completion_tokens
      - total_tokens
    StopConfiguration:
      description: 'Not supported with latest reasoning models `o3` and `o4-mini`.


        Up to 4 sequences where the API will stop generating further tokens. The

        returned text will not contain the stop sequence.

        '
      default: null
      nullable: true
      oneOf:
      - type: string
        default: <|endoftext|>
        example: '

          '
        nullable: true
      - type: array
        minItems: 1
        maxItems: 4
        items:
          type: string
          example: '["\n"]'
    CreateCompletionResponse:
      type: object
      description: 'Represents a completion response from the API. Note: both the streamed and non-streamed response objects share the same shape (unlike the chat endpoint).

        '
      properties:
        id:
          type: string
          description: A unique identifier for the completion.
        choices:
          type: array
          description: The list of completion choices the model generated for the input prompt.
          items:
            type: object
            required:
            - finish_reason
            - index
            - logprobs
            - text
            properties:
              finish_reason:
                type: string
                description: 'The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence,

                  `length` if the maximum number of tokens specified in the request was reached,

                  or `content_filter` if content was omitted due to a flag from our content filters.

                  '
                enum:
                - stop
                - length
                - content_filter
              index:
                type: integer
              logprobs:
                anyOf:
                - type: object
                  properties:
                    text_offset:
                      type: array
                      items:
                        type: integer
                    token_logprobs:
                      type: array
                      items:
                        type: number
                    tokens:
                      type: array
                      items:
                        type: string
                    top_logprobs:
                      type: array
                      items:
                        type: object
                        additionalProperties:
                          type: number
                - type: 'null'
              text:
                type: string
        created:
          type: integer
          format: unixtime
          description: The Unix timestamp (in seconds) of when the completion was created.
        model:
          type: string
          description: The model used for completion.
        system_fingerprint:
          type: string
          description: 'This fingerprint represents the backend configuration that the model runs with.


            Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism.

            '
        object:
          type: string
          description: The object type, which is always "text_completion"
          enum:
          - text_completion
          x-stainless-const: true
        usage:
          $ref: '#/components/schemas/CompletionUsage'
      required:
      - id
      - object
      - created
      - model
      - choices
      x-oaiMeta:
        name: The completion object
        legacy: true
        example: "{\n  \"id\": \"cmpl-uqkvlQyYK7bGYrRHQ0eXlWi7\",\n  \"object\": \"text_completion\",\n  \"created\": 1589478378,\n  \"model\": \"gpt-4-turbo\",\n  \"choices\": [\n    {\n      \"text\": \"\\n\\nThis is indeed a test\",\n      \"index\": 0,\n      \"logprobs\": null,\n      \"finish_reason\": \"length\"\n    }\n  ],\n  \"usage\": {\n    \"prompt_tokens\": 5,\n    \"completion_tokens\": 7,\n    \"total_tokens\": 12\n  }\n}\n"
    ChatCompletionStreamOptions:
      anyOf:
      - description: 'Options for streaming response. Only set this when you set `stream: true`.

          '
        type: object
        default: null
        properties:
          include_usage:
            type: boolean
            description: 'If set, an additional chunk will be streamed before the `data: [DONE]`

              message. The `usage` field on this chunk shows the token usage statistics

              for the entire request, and the `choices` field will always be an empty

              array.


              All other chunks will also include a `usage` field, but with a null

              value. **NOTE:** If the stream is interrupted, you may not receive the

              final usage chunk which contains the total token usage for the request.

              '
          include_obfuscation:
            type: boolean
            description: 'When true, stream obfuscation will be enabled. Stream obfuscation adds

              random characters to an `obfuscation` field on streaming delta events to

              normalize payload sizes as a mitigation to certain side-channel attacks.

              These obfuscation fields are included by default, but add a small amount

              of overhead to the data stream. You can set `include_obfuscation` to

              false to optimize for bandwidth if you trust the network links between

              your application and the OpenAI API.

              '
      - type: 'null'
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
    AdminApiKeyAuth:
      type: http
      scheme: bearer
x-oaiMeta:
  navigationGroups:
  - id: responses
    title: Responses API
  - id: webhooks
    title: Webhooks
  - id: endpoints
    title: Platform APIs
  - id: vector_stores
    title: Vector stores
  - id: chatkit
    title: ChatKit
    beta: true
  - id: containers
    title: Containers
  - id: realtime
    title: Realtime
  - id: chat
    title: Chat Completions
  - id: assistants
    title: Assistants
    deprecated: true
  - id: administration
    title: Administration
  - id: legacy
    title: Legacy
  groups:
  - id: responses-streaming
    title: Streaming events
    description: 'When you [create a Response](/docs/api-reference/responses/create) with

      `stream` set to `true`, the server will emit server-sent events to the

      client as the Response is generated. This section contains the events that

      are emitted by the server.


      [Learn more about streaming responses](/docs/guides/streaming-responses?api-mode=responses).

      '
    navigationGroup: responses
    sections:
    - type: object
      key: ResponseCreatedEvent
      path: <auto>
    - type: object
      key: ResponseInProgressEvent
      path: <auto>
    - type: object
      key: ResponseCompletedEvent
      path: <auto>
    - type: object
      key: ResponseFailedEvent
      path: <auto>
    - type: object
      key: ResponseIncompleteEvent
      path: <auto>
    - type: object
      key: ResponseOutputItemAddedEvent
      path: <auto>
    - type: object
      key: ResponseOutputItemDoneEvent
      path: <auto>
    - type: object
      key: ResponseContentPartAddedEvent
      path: <auto>
    - type: object
      key: ResponseContentPartDoneEvent
      path: <auto>
    - type: object
      key: ResponseTextDeltaEvent
      path: response/output_text/delta
    - type: object
      key: ResponseTextDoneEvent
      path: response/output_text/done
    - type: object
      key: ResponseRefusalDeltaEvent
      path: <auto>
    - type: object
      key: ResponseRefusalDoneEvent
      path: <auto>
    - type: object
      key: ResponseFunctionCallArgumentsDeltaEvent
      path: <auto>
    - type: object
      key: ResponseFunctionCallArgumentsDoneEvent
      path: <auto>
    - type: object
      key: ResponseFileSearchCallInProgressEvent
      path: <auto>
    - type: object
      key: ResponseFileSearchCallSearchingEvent
      path: <auto>
    - type: object
      key: ResponseFileSearchCallCompletedEvent
      path: <auto>
    - type: object
      key: ResponseWebSearchCallInProgressEvent
      path: <auto>
    - type: object
      key: ResponseWebSearchCallSearchingEvent
      path: <auto>
    - type: object
      key: ResponseWebSearchCallCompletedEvent
      path: <auto>
    - type: object
      key: ResponseReasoningSummaryPartAddedEvent
      path: <auto>
    - type: object
      key: ResponseReasoningSummaryPartDoneEvent
      path: <auto>
    - type: object
      key: ResponseReasoningSummaryTextDeltaEvent
      path: <auto>
    - type: object
      key: ResponseReasoningSummaryTextDoneEvent
      path: <auto>
    - type: object
      key: ResponseReasoningTextDeltaEvent
      path: <auto>
    - type: object
      key: ResponseReasoningTextDoneEvent
      path: <auto>
    - type: object
      key: ResponseImageGenCallCompletedEvent
      path: <auto>
    - type: object
      key: ResponseImageGenCallGeneratingEvent
      path: <auto>
    - type: object
      key: ResponseImageGenCallInProgressEvent
      path: <auto>
    - type: object
      key: ResponseImageGenCallPartialImageEvent
      path: <auto>
    - type: object
      key: ResponseMCPCallArgumentsDeltaEvent
      path: <auto>
    - type: object
      key: ResponseMCPCallArgumentsDoneEvent
      path: <auto>
    - type: object
      key: ResponseMCPCallCompletedEvent
      path: <auto>
    - type: object
      key: ResponseMCPCallFailedEvent
      path: <auto>
    - type: object
      key: ResponseMCPCallInProgressEvent
      path: <auto>
    - type: object
      key: ResponseMCPListToolsCompletedEvent
      path: <auto>
    - type: object
      key: ResponseMCPListToolsFailedEvent
      path: <auto>
    - type: object
      key: ResponseMCPListToolsInProgressEvent
      path: <auto>
    - type: object
      key: ResponseCodeInterpreterCallInProgressEvent
      path: <auto>
    - type: object
      key: ResponseCodeInterpreterCallInterpretingEvent
      path: <auto>
    - type: object
      key: ResponseCodeInterpreterCallCompletedEvent
      path: <auto>
    - type: object
      key: ResponseCodeInterpreterCallCodeDeltaEvent
      path: <auto>
    - type: object
      key: ResponseCodeInterpreterCallCodeDoneEvent
      path: <auto>
    - type: object
      key: ResponseOutputTextAnnotationAddedEvent
      path: <auto>
    - type: object
      key: ResponseQueuedEvent
      path: <auto>
    - type: object
      key: ResponseCustomToolCallInputDeltaEvent
      path: <auto>
    - type: object
      key: ResponseCustomToolCallInputDoneEvent
      path: <auto>
    - type: object
      key: ResponseErrorEvent
      path: <auto>
  - id: webhook-events
    title: Webhook Events
    description: 'Webhooks are HTTP requests sent by OpenAI to a URL you specify when certain

      events happen during the course of API usage.


      [Learn more about webhooks](/docs/guides/webhooks).

      '
    navigationGroup: webhooks
    sections:
    - type: object
      key: WebhookResponseCompleted
      path: <auto>
    - type: object
      key: WebhookResponseCancelled
      path: <auto>
    - type: object
      key: WebhookResponseFailed
      path: <auto>
    - type: object
      key: WebhookResponseIncomplete
      path: <auto>
    - type: object
      key: WebhookBatchCompleted
      path: <auto>
    - type: object
      key: WebhookBatchCancelled
      path: <auto>
    - type: object
      key: WebhookBatchExpired
      path: <auto>
    - type: object
      key: WebhookBatchFailed
      path: <auto>
    - type: object
      key: WebhookFineTuningJobSucceeded
      path: <auto>
    - type: object
      key: WebhookFineTuningJobFailed
      path: <auto>
    - type: object
      key: WebhookFineTuningJobCancelled
      path: <auto>
    - type: object
      key: WebhookEvalRunSucceeded
      path: <auto>
    - type: object
      key: WebhookEvalRunFailed
      path: <auto>
    - type: object
      key: WebhookEvalRunCanceled
      path: <auto>
    - type: object
      key: WebhookRealtimeCallIncoming
      path: <auto>
  - id: images-streaming
    title: Image Streaming
    description: 'Stream image generation and editing in real time with server-sent events.

      [Learn more about image streaming](/docs/guides/image-generation).

      '
    navigationGroup: endpoints
    sections:
    - type: object
      key: ImageGenPartialImageEvent
      path: <auto>
    - type: object
      key: ImageGenCompletedEvent
      path: <auto>
    - type: object
      key: ImageEditPartialImageEvent
      path: <auto>
    - type: object
      key: ImageEditCompletedEvent
      path: <auto>
  - id: realtime-client-events
    title: Client events
    description: 'These are events that the OpenAI Realtime WebSocket server will accept from the client.

      '
    navigationGroup: realtime
    sections:
    - type: object
      key: RealtimeClientEventSessionUpdate
      path: <auto>
    - type: object
      key: RealtimeClientEventInputAudioBufferAppend
      path: <auto>
    - type: object
      key: RealtimeClientEventInputAudioBufferCommit
      path: <auto>
    - type: object
      key: RealtimeClientEventInputAudioBufferClear
      path: <auto>
    - type: object
      key: RealtimeClientEventConversationItemCreate
      path: <auto>
    - type: object
      key: RealtimeClientEventConversationItemRetrieve
      path: <auto>
    - type: object
      key: RealtimeClientEventConversationItemTruncate
      path: <auto>
    - type: object
      key: RealtimeClientEventConversationItemDelete
      path: <auto>
    - type: object
      key: RealtimeClientEventResponseCreate
      path: <auto>
    - type: object
      key: RealtimeClientEventResponseCancel
      path: <auto>
    - type: object
      key: RealtimeClientEventOutputAudioBufferClear
      path: <auto>


# --- truncated at 32 KB (44 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/openai/refs/heads/main/openapi/openai-completions-api-openapi.yml