For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Logo
Resources
Log inGet a demo
GuidesAPI reference
GuidesAPI reference
  • API Overview
      • GETList Routing Policies
      • GETList Routing Strategies
      • POSTCreate Draft Policy
      • GETList Draft Policies
      • GETGet Draft Policy
      • DELDelete Draft Policy
      • POSTCommit Draft Policy
UnifiedAgent HandlerGateway
UnifiedAgent HandlerGateway
Resources
Log inGet a demo
API OverviewRouting

Create Draft Policy

POST
https://api-gateway.merge.dev/v1/routing/policies/draft
POST
/v1/routing/policies/draft
$curl -X POST https://api-gateway.merge.dev/v1/routing/policies/draft \
> -H "Content-Type: application/json" \
> -d '{
> "name": "string",
> "strategy": "string",
> "providers": [
> {
> "provider": "string",
> "model": "string"
> }
> ]
>}'
1{
2 "draft_id": "string",
3 "name": "string",
4 "strategy": "string",
5 "providers": [
6 {}
7 ],
8 "expires_in_seconds": 1,
9 "message": "string"
10}

Create a draft routing policy for testing in the simulator.

Draft policies are temporary and expire after 1 hour. Use the returned draft_id as routing_policy_id in requests to test it.

Was this page helpful?
Previous

List Routing Strategies

Next

List Draft Policies

Built with

Request

This endpoint expects an object.
namestringRequired
Name for the policy
strategystringRequired

Routing strategy (e.g., ‘cost_optimized’, ‘single’)

providerslist of objectsRequired
List of providers to route between
descriptionstring or nullOptional
Optional description

Response

Successful Response
draft_idstring
namestring
strategystring
providerslist of maps from strings to any
expires_in_secondsinteger
messagestring

Errors

422
Unprocessable Entity Error