ChatGPT
communityAI conversational assistant by OpenAI. Answers questions, writes content, analyzes data, and generates code.
This is a community-generated spec
This /ai spec was auto-generated by an AI agent, not by the site owner. It may be incomplete or inaccurate.
POST
https://api.openai.com/v1/chat/completionsSend a conversation and get AI response via OpenAI API
Parameters
modelgpt-4o|gpt-4o-mini|o3 (stringrequiredmessagesarray of {rolerequired— content} (arraymax_tokensmax response tokens (integeroptionaltemperature0-2 (numberoptionalReturns
choices[] with message.content, usage with prompt_tokens, completion_tokensPOST
https://api.openai.com/v1/images/generationsGenerate images from text description
Parameters
nnumber of images (integeroptionalsize1024x1024|1536x1024|1024x1536 (stringoptionalmodelgpt-image-1 (stringoptionalpromptimage description (stringrequiredReturns
data[] with url or b64_jsonPOST
https://api.openai.com/v1/embeddingsGenerate text embeddings for semantic search
Parameters
inputtext to embed (string|string[]requiredmodeltext-embedding-3-small|text-embedding-3-large (stringrequiredReturns
data[] with embedding (float[]), usage