Levain LabsLevain Labs
API ReferenceAgents

Set Agent Objective

Set a new objective version for an agent.

Set a new objective version for an agent.

Rewards are computed on read, so the new definition applies to every run, past and future. Earlier versions stay readable at GET /api/v1/agents/{agent_id}/objective/history.

PUT
/api/v1/agents/{agent_id}/objective

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

agent_id*Agent Id

Header Parameters

X-API-Key?string|null

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X PUT "https://api.levainlabs.com/api/v1/agents/string/objective" \  -H "Content-Type: application/json" \  -d '{    "definition": {      "horizon_s": 0,      "terms": [        {          "signal": "string",          "weight": 0        }      ]    }  }'
{
  "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978",
  "version": 0,
  "definition": {
    "horizon_s": 0,
    "default": "exclude",
    "guards": [
      {
        "signal": "string",
        "op": "gt",
        "value": 0
      }
    ],
    "terms": [
      {
        "signal": "string",
        "weight": 0,
        "agg": "first",
        "within_s": 0,
        "scale": [
          0,
          0
        ],
        "missing": "skip",
        "evidence": true
      }
    ],
    "bounds": [
      0,
      1
    ]
  },
  "note": "string",
  "created_by": "string",
  "created_at": "2019-08-24T14:15:22Z"
}