Overseas access: www.kdjingpai.com
Bookmark Us
Current Position:fig. beginning " AI Answers

How do I use Grok-Mirror's API interface? What are the key API parameters?

2025-08-28 1.4 K

Grok-Mirror provides OpenAI-compatible RESTful API interface, the use of the process is as follows:

Basic API Calls

Request endpoints:/v1/chat/completions
Example cURL command:
curl --location "http://127.0.0.1:50005/v1/chat/completions" --header "Content-Type: application/json" --header "Authorization: Bearer YourSsoToken" --data '{"model": "grok-2", "messages": [{"role": "user", "content": "你好!"}]}'

Description of key parameters

  • Authorization: Required SSO Token Authentication Header
  • model: Optionally available grok-2/grok-3 models.
  • messages: Conversation history array (needs to contain role and content)

Advanced Features

  • ad hoc chat: EnableAPI_HATDSystem variables do not keep records
  • batch operation: By/api/batch-add-grok-tokenBatch Import Token
  • Model List::/api/get-grok-listGetting Available Instances

It is recommended that developers pass theMIRROR_API_PREFIXCustomize the API path prefix to avoid conflicts with other services.

Recommended

Can't find AI tools? Try here!

Just type in the keyword Accessibility Bing SearchYou can quickly find all the AI tools on this site.

Top

en_USEnglish