Skip to content

Feature Request: Support proxying Anthropic Managed Agents API endpoints (/v1/agents, /v1/sessions) #2038

@saixso

Description

@saixso

Summary

Anthropic recently launched Claude Managed Agents (public beta), which introduces a new set of stateful API endpoints beyond /v1/messages. Currently, Envoy AI Gateway only proxies model inference endpoints — enterprises deploying the gateway as a centralized AI access layer have no way to route, authenticate, or audit Managed Agents traffic through it.

Background

Managed Agents introduces a new API surface for long-running, stateful agent sessions:

Endpoint Purpose
POST /v1/agents Create a persisted, versioned agent config
POST /v1/sessions Start a session against an agent
GET /v1/sessions/{id}/events/stream SSE stream of agent events
POST /v1/sessions/{id}/events Send user messages / tool results
GET /v1/sessions/{id}/events Poll events (paginated)
POST /v1/environments Provision sandbox environments
POST /v1/vaults Manage MCP credentials

Key characteristics that make gateway support non-trivial:

  • SSE streaming on /events/stream — long-lived connections, not request/response
  • Stateful sessions — clients reconnect to existing sessions; the gateway must not break session affinity
  • Beta headers — requires anthropic-beta: managed-agents-2026-04-01
  • First-party Anthropic only — cannot route through AWS Bedrock; requires a direct api.anthropic.com backend

Problem

Enterprises using Envoy AI Gateway as a centralized proxy gain:

  • Unified auth (API key / JWT)
  • Token cost tracking
  • Audit logging
  • Rate limiting
  • Policy enforcement

Today, any team wanting to use Managed Agents must bypass the gateway entirely and call api.anthropic.com directly with a raw Anthropic API key — losing all of the above.

Desired Behavior

  1. New Backend type (or config option) pointing to api.anthropic.com for first-party Anthropic endpoints
  2. HTTPRoute support for /v1/agents*, /v1/sessions*, /v1/environments*, /v1/vaults*
  3. SSE-aware proxying for /v1/sessions/{id}/events/stream (no buffering, proper text/event-stream passthrough)
  4. Beta header passthrough (anthropic-beta)
  5. Cost metadata extraction from SSE events (token usage is in span.model_request_end events)

Related Issues

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions