Chat & Text Generation
Note: If you receive a '400 Bad Request' with a JSON parsing error, ensure the client is sending a valid JSON payload, properly escaping special characters within strings (e.g., quotes, backslashes).
Your API key
An optional fields mask
A list of message objects, where each object has 'role' (e.g., 'system', 'user', 'assistant') and 'content' (the message string). Ensure strings within 'content' are properly JSON escaped if they contain special characters.
[{"role":"system","content":"You are a helpful assistant."},{"role":"user","content":""}]
Model name
openai
Success