OpenAI APIs · Schema

CreateCompletionRequest

Artificial IntelligenceEmbeddingsImage GenerationLanguage ModelsSpeech

Properties

Name Type Description
model string ID of the model to use (e.g., gpt-3.5-turbo-instruct)
prompt object The prompt(s) to generate completions for
suffix string The suffix that comes after a completion of inserted text
max_tokens integer Maximum number of tokens to generate in the completion
temperature number Sampling temperature between 0 and 2
top_p number Nucleus sampling parameter
n integer Number of completions to generate for each prompt
stream boolean Whether to stream back partial progress
logprobs integer Include log probabilities on the most likely output tokens
echo boolean Echo back the prompt in addition to the completion
stop object Up to 4 sequences where the API will stop generating
presence_penalty number Penalize new tokens based on presence in text so far
frequency_penalty number Penalize new tokens based on frequency in text so far
best_of integer Generates best_of completions and returns the best
logit_bias object Modify the likelihood of specified tokens appearing
user string A unique identifier representing your end-user
View JSON Schema on GitHub

JSON Schema

openai-apis-createcompletionrequest-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/CreateCompletionRequest",
  "title": "CreateCompletionRequest",
  "type": "object",
  "required": [
    "model",
    "prompt"
  ],
  "properties": {
    "model": {
      "type": "string",
      "description": "ID of the model to use (e.g., gpt-3.5-turbo-instruct)",
      "examples": [
        "gpt-3.5-turbo-instruct"
      ]
    },
    "prompt": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      ],
      "description": "The prompt(s) to generate completions for"
    },
    "suffix": {
      "type": "string",
      "description": "The suffix that comes after a completion of inserted text"
    },
    "max_tokens": {
      "type": "integer",
      "default": 16,
      "description": "Maximum number of tokens to generate in the completion"
    },
    "temperature": {
      "type": "number",
      "minimum": 0,
      "maximum": 2,
      "default": 1,
      "description": "Sampling temperature between 0 and 2"
    },
    "top_p": {
      "type": "number",
      "minimum": 0,
      "maximum": 1,
      "default": 1,
      "description": "Nucleus sampling parameter"
    },
    "n": {
      "type": "integer",
      "minimum": 1,
      "default": 1,
      "description": "Number of completions to generate for each prompt"
    },
    "stream": {
      "type": "boolean",
      "default": false,
      "description": "Whether to stream back partial progress"
    },
    "logprobs": {
      "type": "integer",
      "minimum": 0,
      "maximum": 5,
      "description": "Include log probabilities on the most likely output tokens"
    },
    "echo": {
      "type": "boolean",
      "default": false,
      "description": "Echo back the prompt in addition to the completion"
    },
    "stop": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      ],
      "description": "Up to 4 sequences where the API will stop generating"
    },
    "presence_penalty": {
      "type": "number",
      "minimum": -2,
      "maximum": 2,
      "default": 0,
      "description": "Penalize new tokens based on presence in text so far"
    },
    "frequency_penalty": {
      "type": "number",
      "minimum": -2,
      "maximum": 2,
      "default": 0,
      "description": "Penalize new tokens based on frequency in text so far"
    },
    "best_of": {
      "type": "integer",
      "minimum": 1,
      "default": 1,
      "description": "Generates best_of completions and returns the best"
    },
    "logit_bias": {
      "type": "object",
      "additionalProperties": {
        "type": "number"
      },
      "description": "Modify the likelihood of specified tokens appearing"
    },
    "user": {
      "type": "string",
      "description": "A unique identifier representing your end-user"
    }
  }
}