Quickstart

Create an agent with a custom LLM in 3 minutes

Create an AI agent powered by your own custom LLM endpoint.

Create agent with custom LLM

Configure your agent to use your custom LLM endpoint. This example uses a pre-deployed demo endpoint from our example repository.

curl -X POST "https://api.d-id.com/agents" \
  -H "Authorization: Basic <YOUR KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "preview_name": "Custom LLM Agent",
    "presenter": {
      "type": "clip",
      "presenter_id": "v2_public_Amber@0zSz8kflCN",
      "voice": {
        "type": "microsoft",
        "voice_id": "en-US-JennyMultilingualV2Neural"
      }
    },
    "llm": {
      "provider": "custom",
      "instructions": "You are a helpful assistant",
      "custom": {
        "type": "basic",
        "url": "https://jrilqftuclphuad4ukncmcon340qioju.lambda-url.us-west-2.on.aws/",
        "key": "123",
        "streaming": true,
        "max_messages": 20
      }
    }
  }'
{
  "id": "agt_xyz789",
  "preview_name": "Custom LLM Agent",
  "status": "created",
  "llm": {
    "provider": "custom",
    "custom": {
      "type": "basic",
      "url": "https://jrilqftuclphuad4ukncmcon340qioju.lambda-url.us-west-2.on.aws/",
      "streaming": true
    }
  }
}

Save the id - this is your agentId for creating sessions

The url is pointing to our example custom LLM implementation see it on GitHub

Verify agent is ready

Check that your agent was created successfully and is ready to use.

curl -X GET "https://api.d-id.com/agents/agt_xyz789" \
  -H "Authorization: Basic <YOUR KEY>"
{
  "id": "agt_xyz789",
  "preview_name": "Custom LLM Agent",
  "status": "done",
  "presenter": {
    "type": "clip",
    "presenter_id": "v2_public_Amber@0zSz8kflCN",
    "idle_video": "https://clips-presenters.d-id.com/.../idle.mp4"
  },
  "llm": {
    "provider": "custom",
    "instructions": "You are a helpful assistant"
  }
}

Your agent is ready! Status done means you can start creating sessions and having conversations.