English
cURL
curl --request POST \ --url https://ai.kaiho.cc/v1/chat/completions \ --header 'Content-Type: application/json' \ --data ' { "response_format": { "type": "<string>" } } '
API supporting text and image outputs
response_format
Show Multimodal Configuration
multimodal
import openai client = openai.OpenAI( api_key="YOUR_API_KEY", base_url="https://ai.kaiho.cc/v1" ) response = client.chat.completions.create( model="gpt-4o", messages=[ { "role": "user", "content": "Draw a flowchart showing the user registration process" } ], response_format={"type": "multimodal"} ) # Handle multimodal response for item in response.choices[0].message.content: if item.type == "text": print(f"Text: {item.text}") elif item.type == "image_url": print(f"Image: {item.image_url.url}")