OhMyGPT API Docs
  1. Management API
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
  • 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. Management API

Create a New API Key

POST
/api/v1/user/admin/new-api-token
OhMyGPT公开API文档/管理API列表
Use a key with management permissions to create an API Key.
Only the listed model at "WebSettings => EditKey => keyPermissions" names can be filled in permissions.
Note: For security reasons, it is not allowed to create or modify other API Key admin permissions.
Each user is allowed to create up to 5000 API Keys, exceeding this limit will result in an error. If you need to increase the limit, please contact the administrator.
Request Rate Limit: 10 QPS

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
remark
string 
required
API note
Example:
key01
expired_at
string 
required
Key expiration date (ISO 8601 format recommended)
Example:
2024-08-17T08:44:47.886Z
max_fee
string 
required
Maximum consumable token amount (0 for unlimited)
Example:
3500000
permissions
string 
required
Models that can be invoked by the key
Example:
["gpt-3.5-turbo","gpt-3.5-turbo-0301","gpt-4","gpt-4-0314","gpt-4-32k","gpt-4-32k-0314","text-davinci-003","text-davinci-002","text-curie-001","text-babbage-001","text-ada-001","text-embedding-ada-002","text-search-ada-doc-001","dall-e"]

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/api/v1/user/admin/new-api-token' \
--data-urlencode 'remark=key01' \
--data-urlencode 'expired_at=2024-08-17T08:44:47.886Z' \
--data-urlencode 'max_fee=3500000' \
--data-urlencode 'permissions=["gpt-3.5-turbo","gpt-3.5-turbo-0301","gpt-4","gpt-4-0314","gpt-4-32k","gpt-4-32k-0314","text-davinci-003","text-davinci-002","text-curie-001","text-babbage-001","text-ada-001","text-embedding-ada-002","text-search-ada-doc-001","dall-e"]'

Responses

🟢200成功
application/json
Body
statusCode
integer 
required
message
string 
required
data
string 
required
Example
{
    "statusCode": 200,
    "message": "New api token success",
    "data": "sk-CPqHMPIO4uKS7IaHAFLiOHJMJtAmR8LpdXtSdjVUlTDFtDav"
}
Previous
Proxy and Compress Discord Images via WSRV
Next
Update API Key Information
Built with