const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
input: '<string>',
input_items: [{type: '<string>', role: 'user', content: '<string>', phase: 'commentary'}],
conversation: '<string>',
include: ['<string>'],
instructions: '<string>',
max_output_tokens: 2,
max_completion_tokens: 2,
max_tokens: 2,
max_tool_calls: 1,
metadata: {},
parallel_tool_calls: true,
previous_response_id: '<string>',
prompt: {id: '<string>', variables: {}, version: '<string>'},
prompt_cache_key: '<string>',
prompt_cache_retention: '<string>',
provider_options: {openai: {context_management: {type: 'compaction', compact_threshold: 123}}},
providerOptions: {openai: {contextManagement: {type: 'compaction', compactThreshold: 123}}},
reasoning: {effort: 'none', summary: '<string>', enabled: true, max_tokens: 1},
thinking: {
type: 'enabled',
enabled: true,
include_thoughts: true,
includeThoughts: true,
effort: 'none',
max_tokens: 1,
maxTokens: 1,
budget_tokens: 1,
budgetTokens: 1
},
modalities: ['<string>'],
response_modalities: ['<string>'],
responseModalities: ['<string>'],
image_config: {
aspect_ratio: '<string>',
aspectRatio: '<string>',
image_size: '0.5K',
imageSize: '0.5K',
include_rai_reason: true,
includeRaiReason: true,
font_inputs: [{font_url: '<string>', text: '<string>'}],
fontInputs: [{fontUrl: '<string>', text: '<string>'}],
super_resolution_references: ['<string>'],
superResolutionReferences: ['<string>'],
reference_images: [{}],
referenceImages: [{}]
},
imageConfig: {
aspect_ratio: '<string>',
aspectRatio: '<string>',
image_size: '0.5K',
imageSize: '0.5K',
include_rai_reason: true,
includeRaiReason: true,
font_inputs: [{font_url: '<string>', text: '<string>'}],
fontInputs: [{fontUrl: '<string>', text: '<string>'}],
super_resolution_references: ['<string>'],
superResolutionReferences: ['<string>'],
reference_images: [{}],
referenceImages: [{}]
},
safety_identifier: '<string>',
service_tier: '<string>',
speed: '<string>',
store: true,
stream: true,
stream_options: {},
temperature: 1,
text: {},
tool_choice: '<string>',
tools: [{}],
top_logprobs: 10,
top_p: 0.5,
truncation: '<string>',
background: true,
user: '<string>',
usage: true,
meta: true,
debug: {
enabled: true,
return_upstream_request: true,
return_upstream_response: true,
trace: true,
trace_level: 'summary'
},
provider: {
order: ['<string>'],
only: ['<string>'],
ignore: ['<string>'],
include_alpha: true
}
})
};
fetch('https://api.phaseo.app/v1/responses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));