OhMyGPT API Docs
  1. Deprecated
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
        POST
      • Claude2 API
        POST
    • 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. Deprecated

Claude2 API

Deprecated
POST
/v1/claude/web/completion
OhMyGPT公开API文档/大语言模型
Updated on September 3, 2023: Directly integrated with Claude's paid API, the service has been resumed and is no longer free, entering production-ready status.

Current Pricing:
Claude2
Input: $0.013224 / 1000 tokens
Output: $0.039216 / 1000 tokens
Since the unit price per token is $0.004/1000 tokens, the conversion to tokens is:
Input: 3300 tokens / 1000 tokens => 1 token ≈ 3.3 tokens
Output: 9800 tokens / 1000 tokens => 1 token ≈ 9.8 tokens

The parameters are more streamlined compared to the ChatCompletions interface, and the return format is consistent with OpenAI's ChatCompletions interface, which can be seen in the return example below.

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 
required
The model name can only be 'claude-2-web'. Make sure to check this model in the permissions list.
Example:
claude-2-web
prompt
string 
required
The prompt to be inputted (maximum token limit is 90
Example:
What is 1+1?
stream
string 
optional
Whether to return output in stream form
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/claude/web/completion' \
--data-urlencode 'model=claude-2-web' \
--data-urlencode 'prompt=What is 1+1?' \
--data-urlencode 'stream=false'

Responses

🟢200Success
application/json
Body
object {0}
Examples
{
    "id": "chatcmpl-5RP3hTWvJk7mz4rGPIvwylTX3y1gt",
    "object": "chat.completion",
    "created": 1690020567,
    "model": "claude-2-web",
    "choices": [
        {
            "index": 0,
            "message": {
                "role": "assistant",
                "content": " 1 + 1 = 2"
            },
            "finish_reason": "stop"
        }
    ],
    "usage": {
        "prompt_tokens": 8,
        "completion_tokens": 8,
        "total_tokens": 16
    }
}
Previous
ChatCompletions
Next
Anthropic Official Claude API
Built with