Create a routing preset

1 min readEdit this page
POST
/v1/namespaces/{nsid}/routing-presets

Creates a named bundle of request defaults plus routing constraints, selectable per-request via @<name>. The request pipeline shallow-merges the preset's fields into the inbound request.

Requires the routing_preset:write scope.

Authorization

x-api-key<token>

Anthropic-style API key header.

In: header

Path Parameters

nsid*string

Id of the target namespace. Must be owned by the caller (or equal a namespace-baked credential's own namespace), else 404.

Request Body

application/json

Routing preset request body.

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/namespaces/string/routing-presets" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
{  "disabled_at": "2019-08-24T14:15:22Z",  "id": "string",  "model": "string",  "name": "string",  "params": {},  "routing": {    "ignore": [      "string"    ],    "only": [      "string"    ],    "sort": "string"  },  "system_prompt": "string"}
{  "error": {    "code": "string",    "message": "string"  }}
{  "error": {    "code": "string",    "message": "string"  }}
{  "error": {    "code": "string",    "message": "string"  }}

How is this guide?