OhMyGPT API Docs
  1. Chat
OhMyGPT API Docs
  • About This site
  • About new website
  • Midjourney Open API
    • About Midjourney Service
    • Midjourney Blend Image Generation Task Creation
      POST
    • Midjourney Text-to-Image Task Creation
      POST
    • Midjourney Execute Action Task Creation
      POST
    • Midjourney Query Specific Task ID Execution Status
      POST
    • Midjourney Paginated Bulk Query Tasks
      POST
    • Midjourney Describe Prompt Extraction Task Creation
      POST
    • Retrieve Images Generated by Midjourney from Object Storage
      GET
    • Retrieve Compressed Images Generated by Midjourney from Object Storage + WSRV
      GET
    • Retrieve Images Generated by Midjourney from Object Storage + WSRV
      GET
    • Proxy Discord Images via WSRV
      GET
    • Proxy and Compress Discord Images via WSRV
      GET
  • Management API
    • Create a New API Key
      POST
    • Update API Key Information
      POST
    • Query All of User's API Keys
      POST
    • Delete Specified API Key
      POST
    • Query User Membership Expiration Date
      POST
    • User Balance Query
      POST
    • Query the current model rates
      GET
  • OpenAI
    • About OpenAI Compatible API
    • About Azure OpenAI API
    • Audio
      • Text To Speech API
    • Chat
      • Chat Completion
        POST
      • Completion (Legacy)
        POST
    • Images
      • Create Image
    • Realtime API
  • Anthropic Claude
    • Deprecated
      • ChatCompletions
      • Claude2 API
    • Anthropic Official Claude API
  • Policies
    • Terms of Service
    • Privacy Policy
  • Other OpenAPIs
    • Search API
      • Google Custom Search API
      • Google Search By Serper
    • Azure API
      • Get Azure TTS voice list
      • Azure TTS
  1. Chat

Completion (Legacy)

Developing
POST
/v1/completions
Only examples are given here, for full documentation please see the official documentation: https://platform.openai.com/docs/api-reference/completions

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Body Params application/x-www-form-urlencoded
model
string 
optional
model name
Example:
gpt-3.5-turbo-instruct
prompt
string 
optional
Prompt
Example:
Say this is a test.
max_tokens
string 
optional
Max tokens
Example:
100
stream
string 
optional
is stream
Example:
false

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.ohmygpt.com/v1/completions' \
--data-urlencode 'model=gpt-3.5-turbo-instruct' \
--data-urlencode 'prompt=Say this is a test.' \
--data-urlencode 'max_tokens=100' \
--data-urlencode 'stream=false'

Responses

🟢200OK
application/json
Body
object {0}
Examples
{
    "id": "cmpl-8Je8Y67ZfZznh1N0QuUpTeJiOgb9P",
    "object": "text_completion",
    "created": 1699693210,
    "model": "gpt-3.5-turbo-instruct",
    "choices": [
        {
            "text": "\n\nThis is a test.",
            "index": 0,
            "logprobs": null,
            "finish_reason": "stop"
        }
    ],
    "usage": {
        "prompt_tokens": 6,
        "completion_tokens": 6,
        "total_tokens": 12
    }
}
Previous
Chat Completion
Next
Create Image
Built with