⚠️ Using our API via a dedicated deployment? Just replace api.langdock.com with your deployment’s base URL: <deployment-url>/api/public
This is the new Agents API with native Vercel AI SDK compatibility. If you’re using the legacy Assistants API, see the migration guide.
Retrieve the list of models and their ids, available for use with the Agent API. This endpoint is useful when you want to see which models you can use when creating a temporary agent.
try { const response = await axios.get("https://api.langdock.com/agent/v1/models", { headers: { Authorization: "Bearer YOUR_API_KEY", }, });} catch (error) { if (error.response) { switch (error.response.status) { case 400: console.error("Invalid request parameters"); break; case 401: console.error("Invalid API key"); break; case 500: console.error("Internal server error"); break; } }}
You can use any of these model IDs when creating a temporary agent through the Agent API. Simply specify the model ID in the model field of your agent configuration:
Copy
Ask AI
const response = await axios.post("https://api.langdock.com/agent/v1/chat/completions", { agent: { name: "Custom Agent", instructions: "You are a helpful agent", model: "gpt-5", // Specify the model ID here }, messages: [ { id: "msg_1", role: "user", parts: [{ type: "text", text: "Hello!" }] }, ],});
Langdock intentionally blocks browser-origin requests to protect your API key and ensure your applications remain secure. For more information, please see our guide on API Key Best Practices.