Skip to content
v1.0.0

Multiple response types

Example of an OpenAPI document with multiple response types.

Contact

License

MIT

Servers

https://cdn.openai.com/API

Default


ID: getAudio

Get audio

GET
/docs/audio/alloy.wav

Example of a response with an audio file.

Responses

Successful response
audio/wav
Schema
string

Samples

Bruno
get {
  url: https://cdn.openai.com/API/docs/audio/alloy.wav
}

headers {
  Content-Type: application/json
}
Bruno
get {
  url: https://cdn.openai.com/API/docs/audio/alloy.wav
}

headers {
  Content-Type: application/json
}
cURL
curl -X GET \
'https://cdn.openai.com/API/docs/audio/alloy.wav' \
 -H "Content-Type: application/json"
JavaScript
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
<?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;
?>
Python
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.webp

Example of a response with an image file.

Responses

Successful response
image/webp
Schema
string

Samples

Bruno
get {
  url: https://cdn.openai.com/API/images/guides/simple-cat-image-dall-e-3.webp
}

headers {
  Content-Type: application/json
}
Bruno
get {
  url: https://cdn.openai.com/API/images/guides/simple-cat-image-dall-e-3.webp
}

headers {
  Content-Type: application/json
}
cURL
curl -X GET \
'https://cdn.openai.com/API/images/guides/simple-cat-image-dall-e-3.webp' \
 -H "Content-Type: application/json"
JavaScript
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
<?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;
?>
Python
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())

Powered by VitePress OpenAPI