ryan_81480
03/21/2025, 4:42 PMAI Evy
03/21/2025, 4:42 PMAI Evy
03/21/2025, 4:42 PMtypescript
const response = await client.agent
.create({
response_engine: { llm_id: 'llm_234sdertfsdsfsdf', type: 'retell-llm' },
voice_id: '11labs-Adrian',
})
.asResponse();
console.log(response.headers.get('X-My-Header'));
[(2)]()
For Python:
python
response = client.agent.with_raw_response.create(
response_engine={
"llm_id": "llm_234sdertfsdsfsdf",
"type": "retell-llm",
},
voice_id="11labs-Adrian",
)
print(response.headers.get('X-My-Header'))
[(3)]()
However, for custom functions and tool calls, currently there isn't a way to pass custom headers directly [(4)]() [(5)]() .AI Evy
03/21/2025, 4:42 PMryan_81480
03/21/2025, 4:43 PMryan_81480
03/21/2025, 4:43 PMAI Evy
03/21/2025, 4:43 PMAI Evy
03/21/2025, 4:44 PMtypescript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
});
[(1)]()
The Content-Type header is automatically set to application/json when making API requests through the SDK [(2)]() .
For custom requests, you can include headers like this:
javascript
const options = {
method: 'POST',
headers: {
Authorization: '<authorization>',
'Content-Type': 'application/json'
}
};
[(3)]()
Remember that you should get your API key from the "API Keys" tab in your dashboard .AI Evy
03/21/2025, 4:44 PM