v1.0.0
Multiple response types
Example of an OpenAPI document with multiple response types.
Contact
Terms of Service
https://openai.com/termsServers
https://cdn.openai.com/API
Default
ID: getAudio
Get audio
GET
/docs/audio/alloy.wavExample of a response with an audio file.
Responses
Successful responseSchema Schema Schema
audio/wav
string
GET
/docs/audio/alloy.wavSamples
get {
url: https://cdn.openai.com/API/docs/audio/alloy.wav
}
headers {
Content-Type: application/json
}
get {
url: https://cdn.openai.com/API/docs/audio/alloy.wav
}
headers {
Content-Type: application/json
}
curl -X GET \
'https://cdn.openai.com/API/docs/audio/alloy.wav' \
-H "Content-Type: application/json"
fetch('https://cdn.openai.com/API/docs/audio/alloy.wav', {headers:{'Content-Type':'application/json'}})
.then(response => response.json())
.then(data => console.log(data));
<?php
$url = 'https://cdn.openai.com/API/docs/audio/alloy.wav';
$method = 'GET';
$headers = [
'Content-Type' => 'application/json',
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
import requests
url = 'https://cdn.openai.com/API/docs/audio/alloy.wav'
headers = {
'Content-Type': 'application/json'
}
response = requests.get(url, headers=headers)
print(response.json())
ID: getImage
Get image
GET
/images/guides/simple-cat-image-dall-e-3.webpExample of a response with an image file.
Responses
Successful responseSchema Schema Schema
image/webp
string
GET
/images/guides/simple-cat-image-dall-e-3.webpSamples
get {
url: https://cdn.openai.com/API/images/guides/simple-cat-image-dall-e-3.webp
}
headers {
Content-Type: application/json
}
get {
url: https://cdn.openai.com/API/images/guides/simple-cat-image-dall-e-3.webp
}
headers {
Content-Type: application/json
}
curl -X GET \
'https://cdn.openai.com/API/images/guides/simple-cat-image-dall-e-3.webp' \
-H "Content-Type: application/json"
fetch('https://cdn.openai.com/API/images/guides/simple-cat-image-dall-e-3.webp', {headers:{'Content-Type':'application/json'}})
.then(response => response.json())
.then(data => console.log(data));
<?php
$url = 'https://cdn.openai.com/API/images/guides/simple-cat-image-dall-e-3.webp';
$method = 'GET';
$headers = [
'Content-Type' => 'application/json',
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
import requests
url = 'https://cdn.openai.com/API/images/guides/simple-cat-image-dall-e-3.webp'
headers = {
'Content-Type': 'application/json'
}
response = requests.get(url, headers=headers)
print(response.json())