const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
messages: [
{
role: 'system',
content: '<string>',
name: '<string>',
tool_calls: [
{
id: '<string>',
type: 'function',
function: {
name: '<string>',
arguments: '<string>',
description: '<string>',
parameters: {}
}
}
],
tool_call_id: '<string>'
}
],
system: '<string>',
reasoning: {
effort: 'medium',
summary: 'auto',
enabled: true,
max_tokens: 1,
include_thoughts: true,
includeThoughts: true
},
frequency_penalty: 0,
logit_bias: {},
max_output_tokens: 2,
max_completion_tokens: 2,
max_tokens: 2,
meta: false,
debug: {
enabled: true,
return_upstream_request: true,
return_upstream_response: true,
trace: true,
trace_level: 'summary'
},
presence_penalty: 0,
seed: 0,
stream: false,
stream_options: {},
temperature: 1,
tools: [{type: 'function'}],
max_tool_calls: 2,
parallel_tool_calls: true,
tool_choice: '<string>',
top_k: 2,
logprobs: false,
top_logprobs: 10,
top_p: 0.5,
response_format: '<string>',
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: [{}]
},
thinking: {
type: 'enabled',
enabled: true,
include_thoughts: true,
includeThoughts: true,
effort: 'none',
max_tokens: 1,
maxTokens: 1,
budget_tokens: 1,
budgetTokens: 1
},
usage: true,
provider: {
order: ['<string>'],
only: ['<string>'],
ignore: ['<string>'],
include_alpha: true
},
user_id: '<string>',
user: '<string>',
service_tier: 'standard',
speed: '<string>'
})
};
fetch('https://api.phaseo.app/v1/chat/completions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));