OpenAI's ChatCompletion API Supports all OpenAI Chat models, including the latest versions For detailed parameters about this API, you can refer to OpenAI's official documentation: https://platform.openai.com/docs/api-reference/chat/create You can also use this API to call many non-OpenAI models in the format of OpenAI's ChatCompletion API, such as Anthropic's Claude series models, TA, ChatGLM, Cohere, etc. For the specific list of supported models, please refer to the model list on the website settings page, as the content in the documentation may not be maintained in a timely manner
{"model":"gemini-pro-vision","messages":[{"role":"user","content":[{"type":"text","text":"Describe this image"},{"type":"image_url","image_url":"https://pbs.twimg.com/media/GBEB1CbbIAAC28o?format=jpg&name=small"}]}],"stream":false}
Note: It also supports Base64 as image input, and Base64 has higher reliability. Base64 is recommended. The link is used here to avoid excessive word count. Response result:
{"id":"chatcmpl-gPyHaMj77C8Uca3UudUL5zxvAvI3N","object":"chat.completion","created":1702560711,"model":"gemini-pro-vision","choices":[{"index":0,"message":{"role":"assistant","content":" These are emoticons of five different characters. They are:\n- Hu Tao\n- Yao Yao\n- Sayu\n- Keqing\n- Sangonomiya Kokomi"},"finish_reason":"stop"}],"usage":{"prompt_tokens":8,"completion_tokens":48,"total_tokens":56}}
data:{"id":"chatcmpl-6tzfeCctklU06xs8BmDo3b1YcCold","object":"chat.completion.chunk","created":1702562069,"model":"gemini-pro-vision","choices":[{"index":0,"delta":{"role":"assistant","content":" These are emoticons of five different characters. They are:\n- Hu Tao\n- Yao Yao\n- Sayu\n- Keqing\n- Sangonomiya"},"finish_reason":null}]}
data:{"id":"chatcmpl-6tzfeCctklU06xs8BmDo3b1YcCold","object":"chat.completion.chunk","created":1702562069,"model":"gemini-pro-vision","choices":[{"index":0,"delta":{"role":"assistant","content":" Kokomi"},"finish_reason":null}]}
data:[DONE]
Request
Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Body Params application/json
Example
{"model":"gpt-3.5-turbo","messages":[{"role":"system","content":"You are a helpful assistant."},{"role":"user","content":"Say test"}],"stream":false}