Chapter 3 of 211 min

3. Authentication and Request Conventions#

Authentication#

All endpoints use Bearer Token authentication. Put the API Key in the request header:

Text
Authorization: Bearer sk-你的YiTuoToken-Key

A missing or malformed header returns 401 Unauthorized. The gateway only recognizes the Authorization: Bearer header and does not read other custom auth headers such as x-api-key.

Request conventions#

ItemValue
ProtocolHTTPS
Request methodSee each endpoint's description (GET / POST)
Content-Typeapplication/json (multipart/form-data for file-upload endpoints)
Character encodingUTF-8
Base URLhttp://183.240.79.21:52099/v1

Except for file-upload endpoints (image editing, speech transcription), request bodies are uniformly JSON.