# use REST Client VSCode plugin
# ctrl+l
# ctrl+p -> preferences -> REST-Client -- to set environment variable
get https://api.openai.com/v1/models
Authorization: Bearer {{openai_token}}
Content-Type: application/json
get https://api.openai.com/v1/assistants
Authorization: Bearer {{openai_token}}
OpenAI-Beta: assistants=v2
Content-Type: application/json
POST https://api.openai.com/v1/chat/completions
Content-Type: application/json
Authorization: Bearer {{openai_token}}
{
"model": "gpt-4o",
"messages": [
{
"role": "developer",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "What is skynet?"
},
{
"role": "assistant",
"content": "Let me think ab"
}
]
}
POST https://api.openai.com/v1/responses
Content-Type: application/json
Authorization: Bearer {{openai_token}}
{
"model": "gpt-4o",
"input": "Generate image with 2 cars.",
"temperature": 0.7,
"top_p": 1.0
}
POST https://api.openai.com/v1/images/generations
Content-Type: application/json
Authorization: Bearer {{openai_token}}
{
"prompt": "Scene of love",
"n": 1,
"size": "1024x1024"
}