OhMyGPT API Docs
  1. Anthropic Claude
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
      • Completion (Legacy)
    • Images
      • Create Image
    • Realtime API
  • Anthropic Claude
    • Deprecated
      • ChatCompletions
      • Claude2 API
    • Anthropic Official Claude API
      POST
  • 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. Anthropic Claude

Anthropic Official Claude API

POST
/v1/complete
Native Claude Complete API-compatible interface, inputs and outputs provided as-is, API version: anthropic-version: 2023-06-01.
Note: There is a slight difference in the way requests are made with the native API:
1.
authentication method: APIKey, like OpenAI's API, is placed in the request header in the format of a Bearer Token instead of in the x-api-key request header
2.
API version control: anthropic-version header native API is mandatory to fill in, otherwise it will report an error, although it is not mandatory here, but still recommended to fill in, if you do not fill in the default use of the current latest version, such as: 2023-06-01.
supported models:
claude-2
claude-instant-1
Detailed documentation on this API can be found at Anthropic Official Completions Documentation
To use this interface, you only need to replace the API domain name and API key with those of this site and then you can debug and use it directly.
For example, change https://api.anthropic.com/v1/complete to any one of the following:
https://apic.ohmygpt.com/v1/complete
https://aigptx.top/v1/complete
...

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Body Params application/json
model
string 
required
prompt
string 
required
max_tokens_to_sample
integer 
required
stream
boolean 
required
Example
{
    "model": "claude-2",
    "prompt": "\n\nHuman: Say test\n\nAssistant:",
    "max_tokens_to_sample": 999999,
    "stream": 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/complete' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "claude-2",
    "prompt": "\n\nHuman: Say test\n\nAssistant:",
    "max_tokens_to_sample": 999999,
    "stream": false
}'

Responses

🟢200OK
application/json
Body
object {0}
Examples
{
    "completion": " I do not actually speak, I am an AI assistant created by Anthropic to be helpful, harmless, and honest.",
    "stop_reason": "stop_sequence",
    "model": "claude-2.0",
    "stop": "\n\nHuman:",
    "log_id": "5f0e0b3b63866c8c307085b87e2540d8f991ed7a7532621e312c575e5a9f0d07"
}
Previous
Claude2 API
Next
Terms of Service
Built with