Skip to main content
GET
/
assistant
/
v1
/
models
[Deprecated] Lists the available models
curl --request GET \
  --url https://api.langdock.com/assistant/v1/models \
  --header 'Authorization: Bearer <token>'
{
  "object": "list",
  "data": [
    {
      "id": "gpt-4o",
      "object": "model",
      "created": 1686935735000,
      "owned_by": "system"
    },
    {
      "id": "gpt-4o-mini",
      "object": "model",
      "created": 1686935735000,
      "owned_by": "system"
    }
  ]
}
The Assistants API will be deprecated in a future release.For new projects, we recommend using the Agents API. The Agents API provides native Vercel AI SDK compatibility and removes custom transformations.See the migration guide to learn about the differences.
Retrieve the list of models and their ids, available for use with the Assistant API. This endpoint is useful when you want to see which models you can use when creating a temporary assistant.

Example Request

const axios = require("axios");

async function getAvailableModels() {
  try {
    const response = await axios.get("https://api.langdock.com/assistant/v1/models", {
      headers: {
        Authorization: "Bearer YOUR_API_KEY",
      },
    });

    console.log("Available models:", response.data.data);
  } catch (error) {
    console.error("Error fetching models:", error);
  }
}

Response Format

The API returns a list of available models in the following format:

Response Fields

object
string
Always ‘list’, indicating the top-level JSON object type.
data
array<Model>
Array containing available model objects.
id
string
Unique identifier of the model (e.g., gpt-5).
object
string
Always ‘model’, indicating the object type.
created
integer
Unix timestamp (ms) when the model was created.
owned_by
string
Owner of the model (currently always ‘system’).
Example response
{
  "object": "list",
  "data": [
    {
      "id": "gpt-5",
      "object": "model",
      "created": 1686935735000,
      "owned_by": "system"
    }
    // …other models
  ]
}

Error Handling

try {
  const response = await axios.get("https://api.langdock.com/assistant/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 500:
        console.error("Internal server error");
        break;
    }
  }
}
You can use any of these model IDs when creating a temporary Assistant through the assistant API. Simply specify the model ID in the model field of your assistant configuration:
const response = await axios.post("https://api.langdock.com/assistant/v1/chat/completions", {
  assistant: {
    name: "Custom Assistant",
    instructions: "You are a helpful Assistant",
    model: "gpt-5", // Specify the model ID here
  },
  messages: [
    { role: "user", content: "Hello!" },
  ],
});

Migrating to Agents API

The new Agents API offers improved compatibility with modern AI SDKs. The models endpoint has identical functionality. See the equivalent endpoint in the Agents API:
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.

Authorizations

Authorization
string
header
required

API key as Bearer token. Format "Bearer YOUR_API_KEY"

Response

List of available models

object
enum<string>
required
Available options:
list
data
object[]
required