هوش.یارمستندات

API مدیریت

پیکربندی درگاه را با یک اسکریپت یا یک خط لوله بخوانید و تغییر دهید. هر عملیات به یک توکن مدیریت با نقش و دامنهٔ درست نیاز دارد.

نشانی پایه

https://console.example.com/api/v1

سند OpenAPI را دریافت کنید /openapi.json

احراز هویت

توکن مدیریت را در سرآیند Authorization: Bearer بفرستید. مالک سیستم توکن‌ها را در کنسول می‌سازد.

bash
curl https://console.example.com/api/v1/auth/whoami \
  -H "Authorization: Bearer ${HOOSHYAR_TOKEN}"

قواعد نوشتن

  • نوشتن روی یک منبع نسخه‌دار به سرآیند If-Match نیاز دارد. نسخه‌ای را که خوانده‌اید بفرستید. اگر نسخه تغییر کرده باشد، پاسخ 412 است و چیزی تغییر نمی‌کند.
  • برخی نوشتن‌ها به سرآیند Idempotency-Key نیاز دارند. برای هر درخواست یک UUID تازه به کار ببرید. همان کلید را فقط برای تکرار همان درخواست دوباره بفرستید.
  • هر عملیات می‌تواند 429 پاسخ دهد. به اندازهٔ ثانیه‌های Retry-After صبر کنید، سپس دوباره بفرستید.

عملیات‌ها

GET /api/v1/auth/whoami

auth.whoami

هویت فراخواننده و عملیات‌هایی را که اجازهٔ فراخوانی آن‌ها را دارد توصیف کنید.

نقش
member
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "principal": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "user"
            },
            "id": {
              "type": "string"
            },
            "email": {
              "type": "string"
            },
            "role": {
              "type": "string",
              "enum": [
                "member",
                "viewer",
                "admin",
                "owner"
              ]
            }
          },
          "required": [
            "kind",
            "id",
            "email",
            "role"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "token"
            },
            "id": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "tokenPrefix": {
              "type": "string"
            },
            "role": {
              "type": "string",
              "enum": [
                "member",
                "viewer",
                "admin",
                "owner"
              ]
            },
            "scopes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "expiresAt": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "kind",
            "id",
            "name",
            "tokenPrefix",
            "role",
            "scopes",
            "expiresAt"
          ],
          "additionalProperties": false
        }
      ]
    },
    "allowedOperations": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "principal",
    "allowedOperations"
  ],
  "additionalProperties": false
}

GET /api/v1/tokens

tokens.list

توکن‌های خودکارسازی را فهرست کنید (فقط فراداده؛ هرگز رمز یا هش).

نقش
owner
دامنه
tokens:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "tokens": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "tokenPrefix": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "member",
              "viewer",
              "admin",
              "owner"
            ]
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "createdByUserId": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string"
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "lastUsedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "revokedAt": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "name",
          "tokenPrefix",
          "role",
          "scopes",
          "createdByUserId",
          "createdAt",
          "expiresAt",
          "lastUsedAt",
          "revokedAt"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "tokens"
  ],
  "additionalProperties": false
}

POST /api/v1/tokens

tokens.mint

یک توکن خودکارسازی بسازید؛ رمز آن فقط یک بار برگردانده می‌شود.

نقش
owner
دامنه
tokens:write
کلید یکتایی
required
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1
    },
    "role": {
      "type": "string",
      "enum": [
        "viewer",
        "admin",
        "owner"
      ]
    },
    "scopes": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "config:read",
          "config:write",
          "config:apply",
          "keys:read",
          "keys:write",
          "tokens:read",
          "tokens:write",
          "users:read",
          "users:write",
          "providers:read",
          "providers:write",
          "alerts:read",
          "alerts:write",
          "usage:read",
          "reports:write",
          "audit:read",
          "logs:read",
          "guardrails:activity:read",
          "guardrails:read",
          "guardrails:test",
          "retention:read",
          "subscription_lane:read",
          "tools:read",
          "connections:read",
          "packs:read",
          "skills:read"
        ]
      }
    },
    "expiresAt": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "name",
    "role"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "token": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "tokenPrefix": {
          "type": "string"
        },
        "role": {
          "type": "string",
          "enum": [
            "member",
            "viewer",
            "admin",
            "owner"
          ]
        },
        "scopes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "createdByUserId": {
          "type": [
            "string",
            "null"
          ]
        },
        "createdAt": {
          "type": "string"
        },
        "expiresAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "lastUsedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "revokedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "secret": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "name",
        "tokenPrefix",
        "role",
        "scopes",
        "createdByUserId",
        "createdAt",
        "expiresAt",
        "lastUsedAt",
        "revokedAt",
        "secret"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "token"
  ],
  "additionalProperties": false
}

DELETE /api/v1/tokens/{id}

tokens.revoke

یک توکن خودکارسازی را باطل کنید (تکرارپذیر؛ بلافاصله از کار می‌افتد).

نقش
owner
دامنه
tokens:write
تکرار بی‌خطر
✓
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    }
  },
  "required": [
    "ok"
  ],
  "additionalProperties": false
}

GET /api/v1/config

config.read

پیکربندی مسیریابی را به شکل یک سند اعلانی و قابل بازگرداندن بخوانید.

نقش
viewer
دامنه
config:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "document": {
      "type": "object",
      "properties": {
        "schemaVersion": {
          "type": "number",
          "const": 1
        },
        "defaultRoute": {
          "type": "string"
        },
        "classifier": {
          "type": "object",
          "properties": {
            "confidenceThreshold": {
              "type": "number"
            },
            "semanticEnabled": {
              "type": "boolean"
            },
            "encoder": {
              "type": "string"
            },
            "llmFallbackEnabled": {
              "type": "boolean"
            },
            "llmFallbackModel": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "confidenceThreshold",
            "semanticEnabled",
            "encoder",
            "llmFallbackEnabled",
            "llmFallbackModel"
          ],
          "additionalProperties": false
        },
        "routes": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "model": {
                "type": "string"
              },
              "fallbacks": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "params": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              },
              "enabled": {
                "type": "boolean"
              },
              "requireZdr": {
                "default": false,
                "type": "boolean"
              },
              "packBudgetTokens": {
                "default": null,
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "utterances": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "name",
              "model",
              "fallbacks",
              "params",
              "enabled",
              "requireZdr",
              "packBudgetTokens",
              "utterances"
            ],
            "additionalProperties": false
          }
        }
      },
      "required": [
        "schemaVersion",
        "defaultRoute",
        "classifier",
        "routes"
      ],
      "additionalProperties": false
    },
    "version": {
      "type": "number"
    },
    "hash": {
      "type": "string"
    }
  },
  "required": [
    "document",
    "version",
    "hash"
  ],
  "additionalProperties": false
}

PUT /api/v1/config

config.apply

یک سند پیکربندی کامل را اعمال کنید؛ مسیرهایی که در سند نیستند حذف می‌شوند.

نقش
admin
دامنه
config:apply
نیاز به If-Match
✓
کلید یکتایی
required
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "schemaVersion": {
      "type": "number",
      "const": 1
    },
    "defaultRoute": {
      "type": "string"
    },
    "classifier": {
      "type": "object",
      "properties": {
        "confidenceThreshold": {
          "type": "number"
        },
        "semanticEnabled": {
          "type": "boolean"
        },
        "encoder": {
          "type": "string"
        },
        "llmFallbackEnabled": {
          "type": "boolean"
        },
        "llmFallbackModel": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "confidenceThreshold",
        "semanticEnabled",
        "encoder",
        "llmFallbackEnabled",
        "llmFallbackModel"
      ]
    },
    "routes": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "fallbacks": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "params": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "enabled": {
            "type": "boolean"
          },
          "requireZdr": {
            "default": false,
            "type": "boolean"
          },
          "packBudgetTokens": {
            "default": null,
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "utterances": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "name",
          "model",
          "fallbacks",
          "params",
          "enabled",
          "utterances"
        ]
      }
    }
  },
  "required": [
    "schemaVersion",
    "defaultRoute",
    "classifier",
    "routes"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    },
    "applied": {
      "type": "boolean"
    },
    "version": {
      "type": "number"
    },
    "diff": {
      "type": "object",
      "properties": {
        "routes": {
          "type": "object",
          "properties": {
            "added": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "removed": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "changed": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "fields": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "field": {
                          "type": "string"
                        },
                        "from": {},
                        "to": {}
                      },
                      "required": [
                        "field",
                        "from",
                        "to"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "utterances": {
                    "type": "object",
                    "properties": {
                      "added": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "removed": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "required": [
                      "added",
                      "removed"
                    ],
                    "additionalProperties": false
                  },
                  "utterancesReordered": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "name",
                  "fields",
                  "utterances",
                  "utterancesReordered"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": [
            "added",
            "removed",
            "changed"
          ],
          "additionalProperties": false
        },
        "defaultRoute": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "field": {
                  "type": "string"
                },
                "from": {},
                "to": {}
              },
              "required": [
                "field",
                "from",
                "to"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "classifier": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "field": {
                "type": "string"
              },
              "from": {},
              "to": {}
            },
            "required": [
              "field",
              "from",
              "to"
            ],
            "additionalProperties": false
          }
        },
        "empty": {
          "type": "boolean"
        }
      },
      "required": [
        "routes",
        "defaultRoute",
        "classifier",
        "empty"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "ok",
    "applied",
    "version",
    "diff"
  ],
  "additionalProperties": false
}

POST /api/v1/config/validate

config.validate

یک سند پیکربندی را آزمایشی اجرا کنید: خطاها و تفاوت آن با پیکربندی فعلی.

نقش
viewer
دامنه
config:read
تکرار بی‌خطر
✓
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "schemaVersion": {
      "type": "number",
      "const": 1
    },
    "defaultRoute": {
      "type": "string"
    },
    "classifier": {
      "type": "object",
      "properties": {
        "confidenceThreshold": {
          "type": "number"
        },
        "semanticEnabled": {
          "type": "boolean"
        },
        "encoder": {
          "type": "string"
        },
        "llmFallbackEnabled": {
          "type": "boolean"
        },
        "llmFallbackModel": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "confidenceThreshold",
        "semanticEnabled",
        "encoder",
        "llmFallbackEnabled",
        "llmFallbackModel"
      ]
    },
    "routes": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "fallbacks": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "params": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "enabled": {
            "type": "boolean"
          },
          "requireZdr": {
            "default": false,
            "type": "boolean"
          },
          "packBudgetTokens": {
            "default": null,
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "utterances": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "name",
          "model",
          "fallbacks",
          "params",
          "enabled",
          "utterances"
        ]
      }
    }
  },
  "required": [
    "schemaVersion",
    "defaultRoute",
    "classifier",
    "routes"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "valid": {
      "type": "boolean"
    },
    "diagnostics": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "severity": {
            "type": "string",
            "enum": [
              "error",
              "warning"
            ]
          },
          "code": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "severity",
          "code",
          "path",
          "message"
        ],
        "additionalProperties": false
      }
    },
    "diff": {
      "type": "object",
      "properties": {
        "routes": {
          "type": "object",
          "properties": {
            "added": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "removed": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "changed": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "fields": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "field": {
                          "type": "string"
                        },
                        "from": {},
                        "to": {}
                      },
                      "required": [
                        "field",
                        "from",
                        "to"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "utterances": {
                    "type": "object",
                    "properties": {
                      "added": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "removed": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "required": [
                      "added",
                      "removed"
                    ],
                    "additionalProperties": false
                  },
                  "utterancesReordered": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "name",
                  "fields",
                  "utterances",
                  "utterancesReordered"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": [
            "added",
            "removed",
            "changed"
          ],
          "additionalProperties": false
        },
        "defaultRoute": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "field": {
                  "type": "string"
                },
                "from": {},
                "to": {}
              },
              "required": [
                "field",
                "from",
                "to"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "classifier": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "field": {
                "type": "string"
              },
              "from": {},
              "to": {}
            },
            "required": [
              "field",
              "from",
              "to"
            ],
            "additionalProperties": false
          }
        },
        "empty": {
          "type": "boolean"
        }
      },
      "required": [
        "routes",
        "defaultRoute",
        "classifier",
        "empty"
      ],
      "additionalProperties": false
    },
    "baseVersion": {
      "type": "number"
    },
    "documentHash": {
      "type": "string"
    },
    "catalogChecked": {
      "type": "boolean"
    }
  },
  "required": [
    "valid",
    "diagnostics",
    "diff",
    "baseVersion",
    "documentHash",
    "catalogChecked"
  ],
  "additionalProperties": false
}

GET /api/v1/config/generations

config.generations.list

تاریخچهٔ پیکربندی مسیریابی را از جدید به قدیم فهرست کنید: یک مدخل برای هر تغییر.

نقش
viewer
دامنه
config:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "generations": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "version": {
            "type": "number"
          },
          "hash": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "enum": [
              "baseline",
              "route.upsert",
              "route.delete",
              "utterances.replace",
              "settings.update",
              "config.apply"
            ]
          },
          "createdAt": {
            "type": "string"
          },
          "routeCount": {
            "type": "number"
          }
        },
        "required": [
          "version",
          "hash",
          "source",
          "createdAt",
          "routeCount"
        ],
        "additionalProperties": false
      }
    },
    "next": {
      "type": [
        "number",
        "null"
      ]
    }
  },
  "required": [
    "generations",
    "next"
  ],
  "additionalProperties": false
}

GET /api/v1/config/generations/{version}

config.generations.read

یک وضعیت گذشتهٔ پیکربندی را به شکل سند بخوانید، آماده برای بررسی و اعمال دوباره.

نقش
viewer
دامنه
config:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "version": {
      "type": "number"
    },
    "hash": {
      "type": "string"
    },
    "source": {
      "type": "string",
      "enum": [
        "baseline",
        "route.upsert",
        "route.delete",
        "utterances.replace",
        "settings.update",
        "config.apply"
      ]
    },
    "createdAt": {
      "type": "string"
    },
    "routeCount": {
      "type": "number"
    },
    "document": {
      "type": "object",
      "properties": {
        "schemaVersion": {
          "type": "number",
          "const": 1
        },
        "defaultRoute": {
          "type": "string"
        },
        "classifier": {
          "type": "object",
          "properties": {
            "confidenceThreshold": {
              "type": "number"
            },
            "semanticEnabled": {
              "type": "boolean"
            },
            "encoder": {
              "type": "string"
            },
            "llmFallbackEnabled": {
              "type": "boolean"
            },
            "llmFallbackModel": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "confidenceThreshold",
            "semanticEnabled",
            "encoder",
            "llmFallbackEnabled",
            "llmFallbackModel"
          ],
          "additionalProperties": false
        },
        "routes": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "model": {
                "type": "string"
              },
              "fallbacks": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "params": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              },
              "enabled": {
                "type": "boolean"
              },
              "requireZdr": {
                "default": false,
                "type": "boolean"
              },
              "packBudgetTokens": {
                "default": null,
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "utterances": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "name",
              "model",
              "fallbacks",
              "params",
              "enabled",
              "requireZdr",
              "packBudgetTokens",
              "utterances"
            ],
            "additionalProperties": false
          }
        }
      },
      "required": [
        "schemaVersion",
        "defaultRoute",
        "classifier",
        "routes"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "version",
    "hash",
    "source",
    "createdAt",
    "routeCount",
    "document"
  ],
  "additionalProperties": false
}

PUT /api/v1/config/routes/{name}

config.route.upsert

یک مسیر را بسازید یا به‌روز کنید (مدل، جایگزین‌ها، پارامترها، فعال بودن).

نقش
admin
دامنه
config:write
نیاز به If-Match
✓
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "model": {
      "type": "string",
      "minLength": 1
    },
    "fallbacks": {
      "default": [],
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "params": {
      "default": {},
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {}
    },
    "enabled": {
      "default": true,
      "type": "boolean"
    },
    "requireZdr": {
      "default": false,
      "type": "boolean"
    },
    "packBudgetTokens": {
      "default": null,
      "anyOf": [
        {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "model"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    },
    "created": {
      "type": "boolean"
    }
  },
  "required": [
    "ok",
    "created"
  ],
  "additionalProperties": false
}

DELETE /api/v1/config/routes/{name}

config.route.delete

یک مسیر و نمونه‌جمله‌های آن را حذف کنید.

نقش
admin
دامنه
config:write
نیاز به If-Match
✓
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    }
  },
  "required": [
    "ok"
  ],
  "additionalProperties": false
}

PUT /api/v1/config/settings

config.settings.update

مسیر پیش‌فرض و/یا تنظیمات دسته‌بند را به‌روز کنید.

نقش
admin
دامنه
config:write
نیاز به If-Match
✓
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "defaultRoute": {
      "type": "string",
      "minLength": 1
    },
    "classifier": {
      "type": "object",
      "properties": {
        "confidenceThreshold": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "semanticEnabled": {
          "type": "boolean"
        },
        "llmFallbackEnabled": {
          "type": "boolean"
        }
      }
    }
  }
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    }
  },
  "required": [
    "ok"
  ],
  "additionalProperties": false
}

GET /api/v1/models

models.list

فهرست مدل‌های موجود را ببینید؛ این‌ها مقصدهای معتبر یک مسیر هستند.

نقش
viewer
دامنه
config:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "models": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "models"
  ],
  "additionalProperties": false
}

GET /api/v1/usage

usage.report

مصرف درخواست‌ها را بر اساس یک بُعد و در یک بازهٔ زمانی اختیاری تجمیع کنید.

نقش
member
دامنه
usage:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "groupBy": {
      "type": "string",
      "enum": [
        "route",
        "model",
        "user",
        "tag",
        "key",
        "channel",
        "client",
        "session",
        "subject"
      ]
    },
    "from": {
      "type": [
        "string",
        "null"
      ]
    },
    "to": {
      "type": [
        "string",
        "null"
      ]
    },
    "rows": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "group": {
            "type": "string"
          },
          "requests": {
            "type": "number"
          },
          "promptTokens": {
            "type": "number"
          },
          "completionTokens": {
            "type": "number"
          },
          "totalTokens": {
            "type": "number"
          },
          "cachedTokens": {
            "type": "number"
          },
          "avgLatencyMs": {
            "type": "number"
          },
          "p95LatencyMs": {
            "type": "number"
          },
          "avgTtftMs": {
            "type": [
              "number",
              "null"
            ]
          },
          "costUsd": {
            "type": "number"
          },
          "unpricedRequests": {
            "type": "number"
          },
          "subscriptionRequests": {
            "type": "number"
          },
          "imageCount": {
            "type": "number"
          },
          "audioSeconds": {
            "type": "number"
          },
          "characters": {
            "type": "number"
          },
          "documents": {
            "type": "number"
          },
          "subjectName": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "group",
          "requests",
          "promptTokens",
          "completionTokens",
          "totalTokens",
          "cachedTokens",
          "avgLatencyMs",
          "p95LatencyMs",
          "avgTtftMs",
          "costUsd",
          "unpricedRequests",
          "subscriptionRequests",
          "imageCount",
          "audioSeconds",
          "characters",
          "documents",
          "subjectName"
        ],
        "additionalProperties": false
      }
    },
    "truncated": {
      "type": "boolean"
    }
  },
  "required": [
    "groupBy",
    "from",
    "to",
    "rows",
    "truncated"
  ],
  "additionalProperties": false
}

POST /api/v1/reports/run

reports.run

یک گزارش را برای فراخواننده اجرا کنید (گزارش داخلی، ذخیره‌شده یا پیش‌نویس).

نقش
member
دامنه
usage:read
تکرار بی‌خطر
✓
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    },
    "spec": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string",
          "enum": [
            "requests",
            "tool_calls",
            "agent_metrics",
            "outcomes"
          ]
        },
        "dimensions": {
          "maxItems": 2,
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "client",
              "model",
              "route",
              "subject",
              "key",
              "channel",
              "tag",
              "session",
              "server",
              "tool",
              "repository",
              "day",
              "week",
              "month"
            ]
          }
        },
        "measures": {
          "minItems": 1,
          "maxItems": 40,
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "requests",
              "input_tokens",
              "output_tokens",
              "total_tokens",
              "cached_tokens",
              "cost_usd",
              "unpriced_requests",
              "users",
              "sessions",
              "active_hours",
              "latency_avg_ms",
              "latency_p95_ms",
              "ttft_avg_ms",
              "cost_share",
              "request_share",
              "cost_per_user",
              "requests_per_user",
              "cost_per_1k_requests",
              "tokens_per_request",
              "cost_per_1m_tokens",
              "cost_per_1k_sessions",
              "cost_per_active_hour",
              "cache_hit_rate",
              "cost_decomposition",
              "calls",
              "ok",
              "failed",
              "unknown",
              "denied",
              "pending",
              "unpriced_calls",
              "cost_per_ok_call",
              "operations",
              "estimated_cost_usd",
              "merged_prs",
              "reverted_prs",
              "revert_rate",
              "reviews",
              "joined_prs",
              "cost_per_merged_pr"
            ]
          }
        },
        "filters": {
          "type": "object",
          "propertyNames": {
            "type": "string",
            "enum": [
              "client",
              "model",
              "route",
              "subject",
              "key",
              "channel",
              "tag",
              "session",
              "server",
              "tool",
              "repository",
              "day",
              "week",
              "month"
            ]
          },
          "additionalProperties": {
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        },
        "range": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "mtd",
                "last_month"
              ]
            },
            {
              "type": "object",
              "properties": {
                "from": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "to": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "from",
                "to"
              ]
            }
          ]
        },
        "compare": {
          "type": "string",
          "enum": [
            "none",
            "previous_period"
          ]
        },
        "view": {
          "type": "string",
          "enum": [
            "table",
            "bar",
            "line",
            "stacked",
            "waterfall"
          ]
        }
      },
      "required": [
        "source",
        "dimensions",
        "measures",
        "filters",
        "range",
        "compare",
        "view"
      ]
    },
    "limit": {
      "default": 500,
      "type": "integer",
      "minimum": 1,
      "maximum": 5000
    }
  }
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {
      "type": [
        "string",
        "null"
      ]
    },
    "title": {
      "type": [
        "string",
        "null"
      ]
    },
    "result": {
      "type": "object",
      "properties": {
        "spec": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string",
              "enum": [
                "requests",
                "tool_calls",
                "agent_metrics",
                "outcomes"
              ]
            },
            "dimensions": {
              "maxItems": 2,
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "client",
                  "model",
                  "route",
                  "subject",
                  "key",
                  "channel",
                  "tag",
                  "session",
                  "server",
                  "tool",
                  "repository",
                  "day",
                  "week",
                  "month"
                ]
              }
            },
            "measures": {
              "minItems": 1,
              "maxItems": 40,
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "requests",
                  "input_tokens",
                  "output_tokens",
                  "total_tokens",
                  "cached_tokens",
                  "cost_usd",
                  "unpriced_requests",
                  "users",
                  "sessions",
                  "active_hours",
                  "latency_avg_ms",
                  "latency_p95_ms",
                  "ttft_avg_ms",
                  "cost_share",
                  "request_share",
                  "cost_per_user",
                  "requests_per_user",
                  "cost_per_1k_requests",
                  "tokens_per_request",
                  "cost_per_1m_tokens",
                  "cost_per_1k_sessions",
                  "cost_per_active_hour",
                  "cache_hit_rate",
                  "cost_decomposition",
                  "calls",
                  "ok",
                  "failed",
                  "unknown",
                  "denied",
                  "pending",
                  "unpriced_calls",
                  "cost_per_ok_call",
                  "operations",
                  "estimated_cost_usd",
                  "merged_prs",
                  "reverted_prs",
                  "revert_rate",
                  "reviews",
                  "joined_prs",
                  "cost_per_merged_pr"
                ]
              }
            },
            "filters": {
              "type": "object",
              "propertyNames": {
                "type": "string",
                "enum": [
                  "client",
                  "model",
                  "route",
                  "subject",
                  "key",
                  "channel",
                  "tag",
                  "session",
                  "server",
                  "tool",
                  "repository",
                  "day",
                  "week",
                  "month"
                ]
              },
              "additionalProperties": {
                "maxItems": 50,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200
                }
              }
            },
            "range": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "7d",
                    "30d",
                    "mtd",
                    "last_month"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "from": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "to": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "from",
                    "to"
                  ],
                  "additionalProperties": false
                }
              ]
            },
            "compare": {
              "type": "string",
              "enum": [
                "none",
                "previous_period"
              ]
            },
            "view": {
              "type": "string",
              "enum": [
                "table",
                "bar",
                "line",
                "stacked",
                "waterfall"
              ]
            }
          },
          "required": [
            "source",
            "dimensions",
            "measures",
            "filters",
            "range",
            "compare",
            "view"
          ],
          "additionalProperties": false
        },
        "window": {
          "type": "object",
          "properties": {
            "from": {
              "type": [
                "string",
                "null"
              ]
            },
            "to": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "from",
            "to"
          ],
          "additionalProperties": false
        },
        "previousWindow": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "from": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "to": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "from",
                "to"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "rows": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "groups": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "current": {
                "anyOf": [
                  {
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "enum": [
                        "requests",
                        "input_tokens",
                        "output_tokens",
                        "total_tokens",
                        "cached_tokens",
                        "cost_usd",
                        "unpriced_requests",
                        "users",
                        "sessions",
                        "active_hours",
                        "latency_avg_ms",
                        "latency_p95_ms",
                        "ttft_avg_ms",
                        "cost_share",
                        "request_share",
                        "cost_per_user",
                        "requests_per_user",
                        "cost_per_1k_requests",
                        "tokens_per_request",
                        "cost_per_1m_tokens",
                        "cost_per_1k_sessions",
                        "cost_per_active_hour",
                        "cache_hit_rate",
                        "cost_decomposition",
                        "calls",
                        "ok",
                        "failed",
                        "unknown",
                        "denied",
                        "pending",
                        "unpriced_calls",
                        "cost_per_ok_call",
                        "operations",
                        "estimated_cost_usd",
                        "merged_prs",
                        "reverted_prs",
                        "revert_rate",
                        "reviews",
                        "joined_prs",
                        "cost_per_merged_pr"
                      ]
                    },
                    "additionalProperties": {
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "previous": {
                "anyOf": [
                  {
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "enum": [
                        "requests",
                        "input_tokens",
                        "output_tokens",
                        "total_tokens",
                        "cached_tokens",
                        "cost_usd",
                        "unpriced_requests",
                        "users",
                        "sessions",
                        "active_hours",
                        "latency_avg_ms",
                        "latency_p95_ms",
                        "ttft_avg_ms",
                        "cost_share",
                        "request_share",
                        "cost_per_user",
                        "requests_per_user",
                        "cost_per_1k_requests",
                        "tokens_per_request",
                        "cost_per_1m_tokens",
                        "cost_per_1k_sessions",
                        "cost_per_active_hour",
                        "cache_hit_rate",
                        "cost_decomposition",
                        "calls",
                        "ok",
                        "failed",
                        "unknown",
                        "denied",
                        "pending",
                        "unpriced_calls",
                        "cost_per_ok_call",
                        "operations",
                        "estimated_cost_usd",
                        "merged_prs",
                        "reverted_prs",
                        "revert_rate",
                        "reviews",
                        "joined_prs",
                        "cost_per_merged_pr"
                      ]
                    },
                    "additionalProperties": {
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "delta": {
                "anyOf": [
                  {
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "enum": [
                        "requests",
                        "input_tokens",
                        "output_tokens",
                        "total_tokens",
                        "cached_tokens",
                        "cost_usd",
                        "unpriced_requests",
                        "users",
                        "sessions",
                        "active_hours",
                        "latency_avg_ms",
                        "latency_p95_ms",
                        "ttft_avg_ms",
                        "cost_share",
                        "request_share",
                        "cost_per_user",
                        "requests_per_user",
                        "cost_per_1k_requests",
                        "tokens_per_request",
                        "cost_per_1m_tokens",
                        "cost_per_1k_sessions",
                        "cost_per_active_hour",
                        "cache_hit_rate",
                        "cost_decomposition",
                        "calls",
                        "ok",
                        "failed",
                        "unknown",
                        "denied",
                        "pending",
                        "unpriced_calls",
                        "cost_per_ok_call",
                        "operations",
                        "estimated_cost_usd",
                        "merged_prs",
                        "reverted_prs",
                        "revert_rate",
                        "reviews",
                        "joined_prs",
                        "cost_per_merged_pr"
                      ]
                    },
                    "additionalProperties": {
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "floor": {
                "type": "boolean"
              },
              "previousFloor": {
                "type": "boolean"
              }
            },
            "required": [
              "groups",
              "current",
              "previous",
              "delta",
              "floor",
              "previousFloor"
            ],
            "additionalProperties": false
          }
        },
        "total": {
          "type": "object",
          "properties": {
            "groups": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "current": {
              "anyOf": [
                {
                  "type": "object",
                  "propertyNames": {
                    "type": "string",
                    "enum": [
                      "requests",
                      "input_tokens",
                      "output_tokens",
                      "total_tokens",
                      "cached_tokens",
                      "cost_usd",
                      "unpriced_requests",
                      "users",
                      "sessions",
                      "active_hours",
                      "latency_avg_ms",
                      "latency_p95_ms",
                      "ttft_avg_ms",
                      "cost_share",
                      "request_share",
                      "cost_per_user",
                      "requests_per_user",
                      "cost_per_1k_requests",
                      "tokens_per_request",
                      "cost_per_1m_tokens",
                      "cost_per_1k_sessions",
                      "cost_per_active_hour",
                      "cache_hit_rate",
                      "cost_decomposition",
                      "calls",
                      "ok",
                      "failed",
                      "unknown",
                      "denied",
                      "pending",
                      "unpriced_calls",
                      "cost_per_ok_call",
                      "operations",
                      "estimated_cost_usd",
                      "merged_prs",
                      "reverted_prs",
                      "revert_rate",
                      "reviews",
                      "joined_prs",
                      "cost_per_merged_pr"
                    ]
                  },
                  "additionalProperties": {
                    "type": [
                      "number",
                      "null"
                    ]
                  }
                },
                {
                  "type": "null"
                }
              ]
            },
            "previous": {
              "anyOf": [
                {
                  "type": "object",
                  "propertyNames": {
                    "type": "string",
                    "enum": [
                      "requests",
                      "input_tokens",
                      "output_tokens",
                      "total_tokens",
                      "cached_tokens",
                      "cost_usd",
                      "unpriced_requests",
                      "users",
                      "sessions",
                      "active_hours",
                      "latency_avg_ms",
                      "latency_p95_ms",
                      "ttft_avg_ms",
                      "cost_share",
                      "request_share",
                      "cost_per_user",
                      "requests_per_user",
                      "cost_per_1k_requests",
                      "tokens_per_request",
                      "cost_per_1m_tokens",
                      "cost_per_1k_sessions",
                      "cost_per_active_hour",
                      "cache_hit_rate",
                      "cost_decomposition",
                      "calls",
                      "ok",
                      "failed",
                      "unknown",
                      "denied",
                      "pending",
                      "unpriced_calls",
                      "cost_per_ok_call",
                      "operations",
                      "estimated_cost_usd",
                      "merged_prs",
                      "reverted_prs",
                      "revert_rate",
                      "reviews",
                      "joined_prs",
                      "cost_per_merged_pr"
                    ]
                  },
                  "additionalProperties": {
                    "type": [
                      "number",
                      "null"
                    ]
                  }
                },
                {
                  "type": "null"
                }
              ]
            },
            "delta": {
              "anyOf": [
                {
                  "type": "object",
                  "propertyNames": {
                    "type": "string",
                    "enum": [
                      "requests",
                      "input_tokens",
                      "output_tokens",
                      "total_tokens",
                      "cached_tokens",
                      "cost_usd",
                      "unpriced_requests",
                      "users",
                      "sessions",
                      "active_hours",
                      "latency_avg_ms",
                      "latency_p95_ms",
                      "ttft_avg_ms",
                      "cost_share",
                      "request_share",
                      "cost_per_user",
                      "requests_per_user",
                      "cost_per_1k_requests",
                      "tokens_per_request",
                      "cost_per_1m_tokens",
                      "cost_per_1k_sessions",
                      "cost_per_active_hour",
                      "cache_hit_rate",
                      "cost_decomposition",
                      "calls",
                      "ok",
                      "failed",
                      "unknown",
                      "denied",
                      "pending",
                      "unpriced_calls",
                      "cost_per_ok_call",
                      "operations",
                      "estimated_cost_usd",
                      "merged_prs",
                      "reverted_prs",
                      "revert_rate",
                      "reviews",
                      "joined_prs",
                      "cost_per_merged_pr"
                    ]
                  },
                  "additionalProperties": {
                    "type": [
                      "number",
                      "null"
                    ]
                  }
                },
                {
                  "type": "null"
                }
              ]
            },
            "floor": {
              "type": "boolean"
            },
            "previousFloor": {
              "type": "boolean"
            }
          },
          "required": [
            "groups",
            "current",
            "previous",
            "delta",
            "floor",
            "previousFloor"
          ],
          "additionalProperties": false
        },
        "decomposition": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "previousUsd": {
                  "type": "number"
                },
                "currentUsd": {
                  "type": "number"
                },
                "deltaUsd": {
                  "type": "number"
                },
                "parts": {
                  "type": "object",
                  "properties": {
                    "users": {
                      "type": "number"
                    },
                    "requestsPerUser": {
                      "type": "number"
                    },
                    "inputTokensPerRequest": {
                      "type": "number"
                    },
                    "outputTokensPerRequest": {
                      "type": "number"
                    },
                    "pricePerToken": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "users",
                    "requestsPerUser",
                    "inputTokensPerRequest",
                    "outputTokensPerRequest",
                    "pricePerToken"
                  ],
                  "additionalProperties": false
                },
                "unmodelledUsd": {
                  "type": "number"
                },
                "floor": {
                  "type": "boolean"
                }
              },
              "required": [
                "previousUsd",
                "currentUsd",
                "deltaUsd",
                "parts",
                "unmodelledUsd",
                "floor"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "coverage": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "dimensionsSince": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "rowsBefore": {
                  "type": "number"
                },
                "previousRowsBefore": {
                  "type": [
                    "number",
                    "null"
                  ]
                }
              },
              "required": [
                "dimensionsSince",
                "rowsBefore",
                "previousRowsBefore"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "spec",
        "window",
        "previousWindow",
        "rows",
        "total",
        "decomposition",
        "coverage"
      ],
      "additionalProperties": false
    },
    "rowCount": {
      "type": "number"
    },
    "truncated": {
      "type": "boolean"
    }
  },
  "required": [
    "id",
    "title",
    "result",
    "rowCount",
    "truncated"
  ],
  "additionalProperties": false
}

GET /api/v1/reports

reports.list

گزارش‌هایی را که فراخواننده می‌تواند باز کند فهرست کنید: داخلی، متعلق به خودش و مشترک با نقشش.

نقش
viewer
دامنه
usage:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "builtIn": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "built_in",
              "saved"
            ]
          },
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "spec": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string",
                "enum": [
                  "requests",
                  "tool_calls",
                  "agent_metrics",
                  "outcomes"
                ]
              },
              "dimensions": {
                "maxItems": 2,
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "client",
                    "model",
                    "route",
                    "subject",
                    "key",
                    "channel",
                    "tag",
                    "session",
                    "server",
                    "tool",
                    "repository",
                    "day",
                    "week",
                    "month"
                  ]
                }
              },
              "measures": {
                "minItems": 1,
                "maxItems": 40,
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "requests",
                    "input_tokens",
                    "output_tokens",
                    "total_tokens",
                    "cached_tokens",
                    "cost_usd",
                    "unpriced_requests",
                    "users",
                    "sessions",
                    "active_hours",
                    "latency_avg_ms",
                    "latency_p95_ms",
                    "ttft_avg_ms",
                    "cost_share",
                    "request_share",
                    "cost_per_user",
                    "requests_per_user",
                    "cost_per_1k_requests",
                    "tokens_per_request",
                    "cost_per_1m_tokens",
                    "cost_per_1k_sessions",
                    "cost_per_active_hour",
                    "cache_hit_rate",
                    "cost_decomposition",
                    "calls",
                    "ok",
                    "failed",
                    "unknown",
                    "denied",
                    "pending",
                    "unpriced_calls",
                    "cost_per_ok_call",
                    "operations",
                    "estimated_cost_usd",
                    "merged_prs",
                    "reverted_prs",
                    "revert_rate",
                    "reviews",
                    "joined_prs",
                    "cost_per_merged_pr"
                  ]
                }
              },
              "filters": {
                "type": "object",
                "propertyNames": {
                  "type": "string",
                  "enum": [
                    "client",
                    "model",
                    "route",
                    "subject",
                    "key",
                    "channel",
                    "tag",
                    "session",
                    "server",
                    "tool",
                    "repository",
                    "day",
                    "week",
                    "month"
                  ]
                },
                "additionalProperties": {
                  "maxItems": 50,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  }
                }
              },
              "range": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "7d",
                      "30d",
                      "mtd",
                      "last_month"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "from": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "to": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "from",
                      "to"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              "compare": {
                "type": "string",
                "enum": [
                  "none",
                  "previous_period"
                ]
              },
              "view": {
                "type": "string",
                "enum": [
                  "table",
                  "bar",
                  "line",
                  "stacked",
                  "waterfall"
                ]
              }
            },
            "required": [
              "source",
              "dimensions",
              "measures",
              "filters",
              "range",
              "compare",
              "view"
            ],
            "additionalProperties": false
          },
          "ownerEmail": {
            "type": [
              "string",
              "null"
            ]
          },
          "visibility": {
            "type": "string",
            "enum": [
              "private",
              "role:viewer",
              "role:admin",
              "role:owner"
            ]
          },
          "pinned": {
            "type": "boolean"
          },
          "editable": {
            "type": "boolean"
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "kind",
          "id",
          "title",
          "description",
          "spec",
          "ownerEmail",
          "visibility",
          "pinned",
          "editable",
          "updatedAt"
        ],
        "additionalProperties": false
      }
    },
    "mine": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "built_in",
              "saved"
            ]
          },
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "spec": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string",
                "enum": [
                  "requests",
                  "tool_calls",
                  "agent_metrics",
                  "outcomes"
                ]
              },
              "dimensions": {
                "maxItems": 2,
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "client",
                    "model",
                    "route",
                    "subject",
                    "key",
                    "channel",
                    "tag",
                    "session",
                    "server",
                    "tool",
                    "repository",
                    "day",
                    "week",
                    "month"
                  ]
                }
              },
              "measures": {
                "minItems": 1,
                "maxItems": 40,
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "requests",
                    "input_tokens",
                    "output_tokens",
                    "total_tokens",
                    "cached_tokens",
                    "cost_usd",
                    "unpriced_requests",
                    "users",
                    "sessions",
                    "active_hours",
                    "latency_avg_ms",
                    "latency_p95_ms",
                    "ttft_avg_ms",
                    "cost_share",
                    "request_share",
                    "cost_per_user",
                    "requests_per_user",
                    "cost_per_1k_requests",
                    "tokens_per_request",
                    "cost_per_1m_tokens",
                    "cost_per_1k_sessions",
                    "cost_per_active_hour",
                    "cache_hit_rate",
                    "cost_decomposition",
                    "calls",
                    "ok",
                    "failed",
                    "unknown",
                    "denied",
                    "pending",
                    "unpriced_calls",
                    "cost_per_ok_call",
                    "operations",
                    "estimated_cost_usd",
                    "merged_prs",
                    "reverted_prs",
                    "revert_rate",
                    "reviews",
                    "joined_prs",
                    "cost_per_merged_pr"
                  ]
                }
              },
              "filters": {
                "type": "object",
                "propertyNames": {
                  "type": "string",
                  "enum": [
                    "client",
                    "model",
                    "route",
                    "subject",
                    "key",
                    "channel",
                    "tag",
                    "session",
                    "server",
                    "tool",
                    "repository",
                    "day",
                    "week",
                    "month"
                  ]
                },
                "additionalProperties": {
                  "maxItems": 50,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  }
                }
              },
              "range": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "7d",
                      "30d",
                      "mtd",
                      "last_month"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "from": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "to": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "from",
                      "to"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              "compare": {
                "type": "string",
                "enum": [
                  "none",
                  "previous_period"
                ]
              },
              "view": {
                "type": "string",
                "enum": [
                  "table",
                  "bar",
                  "line",
                  "stacked",
                  "waterfall"
                ]
              }
            },
            "required": [
              "source",
              "dimensions",
              "measures",
              "filters",
              "range",
              "compare",
              "view"
            ],
            "additionalProperties": false
          },
          "ownerEmail": {
            "type": [
              "string",
              "null"
            ]
          },
          "visibility": {
            "type": "string",
            "enum": [
              "private",
              "role:viewer",
              "role:admin",
              "role:owner"
            ]
          },
          "pinned": {
            "type": "boolean"
          },
          "editable": {
            "type": "boolean"
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "kind",
          "id",
          "title",
          "description",
          "spec",
          "ownerEmail",
          "visibility",
          "pinned",
          "editable",
          "updatedAt"
        ],
        "additionalProperties": false
      }
    },
    "shared": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "built_in",
              "saved"
            ]
          },
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "spec": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string",
                "enum": [
                  "requests",
                  "tool_calls",
                  "agent_metrics",
                  "outcomes"
                ]
              },
              "dimensions": {
                "maxItems": 2,
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "client",
                    "model",
                    "route",
                    "subject",
                    "key",
                    "channel",
                    "tag",
                    "session",
                    "server",
                    "tool",
                    "repository",
                    "day",
                    "week",
                    "month"
                  ]
                }
              },
              "measures": {
                "minItems": 1,
                "maxItems": 40,
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "requests",
                    "input_tokens",
                    "output_tokens",
                    "total_tokens",
                    "cached_tokens",
                    "cost_usd",
                    "unpriced_requests",
                    "users",
                    "sessions",
                    "active_hours",
                    "latency_avg_ms",
                    "latency_p95_ms",
                    "ttft_avg_ms",
                    "cost_share",
                    "request_share",
                    "cost_per_user",
                    "requests_per_user",
                    "cost_per_1k_requests",
                    "tokens_per_request",
                    "cost_per_1m_tokens",
                    "cost_per_1k_sessions",
                    "cost_per_active_hour",
                    "cache_hit_rate",
                    "cost_decomposition",
                    "calls",
                    "ok",
                    "failed",
                    "unknown",
                    "denied",
                    "pending",
                    "unpriced_calls",
                    "cost_per_ok_call",
                    "operations",
                    "estimated_cost_usd",
                    "merged_prs",
                    "reverted_prs",
                    "revert_rate",
                    "reviews",
                    "joined_prs",
                    "cost_per_merged_pr"
                  ]
                }
              },
              "filters": {
                "type": "object",
                "propertyNames": {
                  "type": "string",
                  "enum": [
                    "client",
                    "model",
                    "route",
                    "subject",
                    "key",
                    "channel",
                    "tag",
                    "session",
                    "server",
                    "tool",
                    "repository",
                    "day",
                    "week",
                    "month"
                  ]
                },
                "additionalProperties": {
                  "maxItems": 50,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  }
                }
              },
              "range": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "7d",
                      "30d",
                      "mtd",
                      "last_month"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "from": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "to": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "from",
                      "to"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              "compare": {
                "type": "string",
                "enum": [
                  "none",
                  "previous_period"
                ]
              },
              "view": {
                "type": "string",
                "enum": [
                  "table",
                  "bar",
                  "line",
                  "stacked",
                  "waterfall"
                ]
              }
            },
            "required": [
              "source",
              "dimensions",
              "measures",
              "filters",
              "range",
              "compare",
              "view"
            ],
            "additionalProperties": false
          },
          "ownerEmail": {
            "type": [
              "string",
              "null"
            ]
          },
          "visibility": {
            "type": "string",
            "enum": [
              "private",
              "role:viewer",
              "role:admin",
              "role:owner"
            ]
          },
          "pinned": {
            "type": "boolean"
          },
          "editable": {
            "type": "boolean"
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "kind",
          "id",
          "title",
          "description",
          "spec",
          "ownerEmail",
          "visibility",
          "pinned",
          "editable",
          "updatedAt"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "builtIn",
    "mine",
    "shared"
  ],
  "additionalProperties": false
}

POST /api/v1/reports

reports.save

یک گزارش را برای فراخواننده ذخیره کنید: یکی بسازید یا گزارش خودتان را جایگزین کنید. فقط پرسش ذخیره می‌شود، نه عددها.

نقش
viewer
دامنه
reports:write
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "description": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 500
        },
        {
          "type": "null"
        }
      ]
    },
    "spec": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string",
          "enum": [
            "requests",
            "tool_calls",
            "agent_metrics",
            "outcomes"
          ]
        },
        "dimensions": {
          "maxItems": 2,
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "client",
              "model",
              "route",
              "subject",
              "key",
              "channel",
              "tag",
              "session",
              "server",
              "tool",
              "repository",
              "day",
              "week",
              "month"
            ]
          }
        },
        "measures": {
          "minItems": 1,
          "maxItems": 40,
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "requests",
              "input_tokens",
              "output_tokens",
              "total_tokens",
              "cached_tokens",
              "cost_usd",
              "unpriced_requests",
              "users",
              "sessions",
              "active_hours",
              "latency_avg_ms",
              "latency_p95_ms",
              "ttft_avg_ms",
              "cost_share",
              "request_share",
              "cost_per_user",
              "requests_per_user",
              "cost_per_1k_requests",
              "tokens_per_request",
              "cost_per_1m_tokens",
              "cost_per_1k_sessions",
              "cost_per_active_hour",
              "cache_hit_rate",
              "cost_decomposition",
              "calls",
              "ok",
              "failed",
              "unknown",
              "denied",
              "pending",
              "unpriced_calls",
              "cost_per_ok_call",
              "operations",
              "estimated_cost_usd",
              "merged_prs",
              "reverted_prs",
              "revert_rate",
              "reviews",
              "joined_prs",
              "cost_per_merged_pr"
            ]
          }
        },
        "filters": {
          "type": "object",
          "propertyNames": {
            "type": "string",
            "enum": [
              "client",
              "model",
              "route",
              "subject",
              "key",
              "channel",
              "tag",
              "session",
              "server",
              "tool",
              "repository",
              "day",
              "week",
              "month"
            ]
          },
          "additionalProperties": {
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        },
        "range": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "mtd",
                "last_month"
              ]
            },
            {
              "type": "object",
              "properties": {
                "from": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "to": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "from",
                "to"
              ]
            }
          ]
        },
        "compare": {
          "type": "string",
          "enum": [
            "none",
            "previous_period"
          ]
        },
        "view": {
          "type": "string",
          "enum": [
            "table",
            "bar",
            "line",
            "stacked",
            "waterfall"
          ]
        }
      },
      "required": [
        "source",
        "dimensions",
        "measures",
        "filters",
        "range",
        "compare",
        "view"
      ]
    },
    "visibility": {
      "default": "private",
      "type": "string",
      "enum": [
        "private",
        "role:viewer",
        "role:admin",
        "role:owner"
      ]
    },
    "pinned": {
      "default": false,
      "type": "boolean"
    },
    "id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    }
  },
  "required": [
    "title",
    "spec"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "report": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "built_in",
            "saved"
          ]
        },
        "id": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "spec": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string",
              "enum": [
                "requests",
                "tool_calls",
                "agent_metrics",
                "outcomes"
              ]
            },
            "dimensions": {
              "maxItems": 2,
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "client",
                  "model",
                  "route",
                  "subject",
                  "key",
                  "channel",
                  "tag",
                  "session",
                  "server",
                  "tool",
                  "repository",
                  "day",
                  "week",
                  "month"
                ]
              }
            },
            "measures": {
              "minItems": 1,
              "maxItems": 40,
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "requests",
                  "input_tokens",
                  "output_tokens",
                  "total_tokens",
                  "cached_tokens",
                  "cost_usd",
                  "unpriced_requests",
                  "users",
                  "sessions",
                  "active_hours",
                  "latency_avg_ms",
                  "latency_p95_ms",
                  "ttft_avg_ms",
                  "cost_share",
                  "request_share",
                  "cost_per_user",
                  "requests_per_user",
                  "cost_per_1k_requests",
                  "tokens_per_request",
                  "cost_per_1m_tokens",
                  "cost_per_1k_sessions",
                  "cost_per_active_hour",
                  "cache_hit_rate",
                  "cost_decomposition",
                  "calls",
                  "ok",
                  "failed",
                  "unknown",
                  "denied",
                  "pending",
                  "unpriced_calls",
                  "cost_per_ok_call",
                  "operations",
                  "estimated_cost_usd",
                  "merged_prs",
                  "reverted_prs",
                  "revert_rate",
                  "reviews",
                  "joined_prs",
                  "cost_per_merged_pr"
                ]
              }
            },
            "filters": {
              "type": "object",
              "propertyNames": {
                "type": "string",
                "enum": [
                  "client",
                  "model",
                  "route",
                  "subject",
                  "key",
                  "channel",
                  "tag",
                  "session",
                  "server",
                  "tool",
                  "repository",
                  "day",
                  "week",
                  "month"
                ]
              },
              "additionalProperties": {
                "maxItems": 50,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200
                }
              }
            },
            "range": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "7d",
                    "30d",
                    "mtd",
                    "last_month"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "from": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "to": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "from",
                    "to"
                  ],
                  "additionalProperties": false
                }
              ]
            },
            "compare": {
              "type": "string",
              "enum": [
                "none",
                "previous_period"
              ]
            },
            "view": {
              "type": "string",
              "enum": [
                "table",
                "bar",
                "line",
                "stacked",
                "waterfall"
              ]
            }
          },
          "required": [
            "source",
            "dimensions",
            "measures",
            "filters",
            "range",
            "compare",
            "view"
          ],
          "additionalProperties": false
        },
        "ownerEmail": {
          "type": [
            "string",
            "null"
          ]
        },
        "visibility": {
          "type": "string",
          "enum": [
            "private",
            "role:viewer",
            "role:admin",
            "role:owner"
          ]
        },
        "pinned": {
          "type": "boolean"
        },
        "editable": {
          "type": "boolean"
        },
        "updatedAt": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "kind",
        "id",
        "title",
        "description",
        "spec",
        "ownerEmail",
        "visibility",
        "pinned",
        "editable",
        "updatedAt"
      ],
      "additionalProperties": false
    },
    "created": {
      "type": "boolean"
    }
  },
  "required": [
    "report",
    "created"
  ],
  "additionalProperties": false
}

GET /api/v1/usage/series

usage.series

مصرف را برای هر ساعت یا روز بخوانید: درخواست‌ها، توکن‌ها، هزینه و صدک‌های تأخیر و زمان تا نخستین توکن.

نقش
viewer
دامنه
usage:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "bucket": {
      "type": "string",
      "enum": [
        "hour",
        "day"
      ]
    },
    "from": {
      "type": [
        "string",
        "null"
      ]
    },
    "to": {
      "type": [
        "string",
        "null"
      ]
    },
    "points": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "bucket": {
            "type": "string"
          },
          "requests": {
            "type": "number"
          },
          "totalTokens": {
            "type": "number"
          },
          "cachedTokens": {
            "type": "number"
          },
          "costUsd": {
            "type": "number"
          },
          "avgLatencyMs": {
            "type": "number"
          },
          "p50LatencyMs": {
            "type": "number"
          },
          "p95LatencyMs": {
            "type": "number"
          },
          "p50TtftMs": {
            "type": [
              "number",
              "null"
            ]
          },
          "p95TtftMs": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "required": [
          "bucket",
          "requests",
          "totalTokens",
          "cachedTokens",
          "costUsd",
          "avgLatencyMs",
          "p50LatencyMs",
          "p95LatencyMs",
          "p50TtftMs",
          "p95TtftMs"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "bucket",
    "from",
    "to",
    "points"
  ],
  "additionalProperties": false
}

GET /api/v1/usage/spend-split

usage.spend-split

هزینهٔ تعاملی و هزینهٔ دسته‌ای یک بازه را کنار هم بخوانید. فقط مبلغ‌ها با هم جمع می‌شوند.

نقش
viewer
دامنه
usage:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "interactive": {
      "type": "object",
      "properties": {
        "requests": {
          "type": "number"
        },
        "totalTokens": {
          "type": "number"
        },
        "costUsd": {
          "type": "number"
        },
        "unpricedRequests": {
          "type": "number"
        }
      },
      "required": [
        "requests",
        "totalTokens",
        "costUsd",
        "unpricedRequests"
      ],
      "additionalProperties": false
    },
    "batch": {
      "type": "object",
      "properties": {
        "batches": {
          "type": "number"
        },
        "logicalRequests": {
          "type": "number"
        },
        "totalTokens": {
          "type": "number"
        },
        "costUsd": {
          "type": "number"
        },
        "unpricedRows": {
          "type": "number"
        }
      },
      "required": [
        "batches",
        "logicalRequests",
        "totalTokens",
        "costUsd",
        "unpricedRows"
      ],
      "additionalProperties": false
    },
    "byModel": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string"
          },
          "batches": {
            "type": "number"
          },
          "logicalRequests": {
            "type": "number"
          },
          "totalTokens": {
            "type": "number"
          },
          "cachedTokens": {
            "type": "number"
          },
          "costUsd": {
            "type": "number"
          },
          "unpricedRows": {
            "type": "number"
          }
        },
        "required": [
          "model",
          "batches",
          "logicalRequests",
          "totalTokens",
          "cachedTokens",
          "costUsd",
          "unpricedRows"
        ],
        "additionalProperties": false
      }
    },
    "combinedCostUsd": {
      "type": "number"
    },
    "caveat": {
      "type": "string"
    }
  },
  "required": [
    "interactive",
    "batch",
    "byModel",
    "combinedCostUsd",
    "caveat"
  ],
  "additionalProperties": false
}

GET /api/v1/reports/executive

reports.executive

خلاصهٔ مدیریتی را بخوانید: هزینه، ترافیک، تأخیر، مسیرها و مدل‌های پرهزینه و هشدارهای اعتبار.

نقش
viewer
دامنه
usage:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "from": {
      "type": [
        "string",
        "null"
      ]
    },
    "to": {
      "type": [
        "string",
        "null"
      ]
    },
    "cost": {
      "type": "object",
      "properties": {
        "usd": {
          "type": "number"
        },
        "unpricedRequests": {
          "type": "number"
        },
        "subscriptionRequests": {
          "type": "number"
        },
        "requests": {
          "type": "number"
        }
      },
      "required": [
        "usd",
        "unpricedRequests",
        "subscriptionRequests",
        "requests"
      ],
      "additionalProperties": false
    },
    "requests": {
      "type": "number"
    },
    "totalTokens": {
      "type": "number"
    },
    "cachedTokens": {
      "type": "number"
    },
    "avgLatencyMs": {
      "type": "number"
    },
    "p95LatencyMs": {
      "type": "number"
    },
    "avgTtftMs": {
      "type": [
        "number",
        "null"
      ]
    },
    "series": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "bucket": {
            "type": "string"
          },
          "requests": {
            "type": "number"
          },
          "totalTokens": {
            "type": "number"
          },
          "cachedTokens": {
            "type": "number"
          },
          "costUsd": {
            "type": "number"
          },
          "avgLatencyMs": {
            "type": "number"
          },
          "p50LatencyMs": {
            "type": "number"
          },
          "p95LatencyMs": {
            "type": "number"
          },
          "p50TtftMs": {
            "type": [
              "number",
              "null"
            ]
          },
          "p95TtftMs": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "required": [
          "bucket",
          "requests",
          "totalTokens",
          "cachedTokens",
          "costUsd",
          "avgLatencyMs",
          "p50LatencyMs",
          "p95LatencyMs",
          "p50TtftMs",
          "p95TtftMs"
        ],
        "additionalProperties": false
      }
    },
    "topRoutes": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "group": {
            "type": "string"
          },
          "requests": {
            "type": "number"
          },
          "promptTokens": {
            "type": "number"
          },
          "completionTokens": {
            "type": "number"
          },
          "totalTokens": {
            "type": "number"
          },
          "cachedTokens": {
            "type": "number"
          },
          "avgLatencyMs": {
            "type": "number"
          },
          "p95LatencyMs": {
            "type": "number"
          },
          "avgTtftMs": {
            "type": [
              "number",
              "null"
            ]
          },
          "costUsd": {
            "type": "number"
          },
          "unpricedRequests": {
            "type": "number"
          },
          "subscriptionRequests": {
            "type": "number"
          },
          "imageCount": {
            "type": "number"
          },
          "audioSeconds": {
            "type": "number"
          },
          "characters": {
            "type": "number"
          },
          "documents": {
            "type": "number"
          }
        },
        "required": [
          "group",
          "requests",
          "promptTokens",
          "completionTokens",
          "totalTokens",
          "cachedTokens",
          "avgLatencyMs",
          "p95LatencyMs",
          "avgTtftMs",
          "costUsd",
          "unpricedRequests",
          "subscriptionRequests",
          "imageCount",
          "audioSeconds",
          "characters",
          "documents"
        ],
        "additionalProperties": false
      }
    },
    "topModels": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "group": {
            "type": "string"
          },
          "requests": {
            "type": "number"
          },
          "promptTokens": {
            "type": "number"
          },
          "completionTokens": {
            "type": "number"
          },
          "totalTokens": {
            "type": "number"
          },
          "cachedTokens": {
            "type": "number"
          },
          "avgLatencyMs": {
            "type": "number"
          },
          "p95LatencyMs": {
            "type": "number"
          },
          "avgTtftMs": {
            "type": [
              "number",
              "null"
            ]
          },
          "costUsd": {
            "type": "number"
          },
          "unpricedRequests": {
            "type": "number"
          },
          "subscriptionRequests": {
            "type": "number"
          },
          "imageCount": {
            "type": "number"
          },
          "audioSeconds": {
            "type": "number"
          },
          "characters": {
            "type": "number"
          },
          "documents": {
            "type": "number"
          }
        },
        "required": [
          "group",
          "requests",
          "promptTokens",
          "completionTokens",
          "totalTokens",
          "cachedTokens",
          "avgLatencyMs",
          "p95LatencyMs",
          "avgTtftMs",
          "costUsd",
          "unpricedRequests",
          "subscriptionRequests",
          "imageCount",
          "audioSeconds",
          "characters",
          "documents"
        ],
        "additionalProperties": false
      }
    },
    "activeKeys": {
      "type": "number"
    },
    "creditAlerts": {
      "type": "number"
    }
  },
  "required": [
    "from",
    "to",
    "cost",
    "requests",
    "totalTokens",
    "cachedTokens",
    "avgLatencyMs",
    "p95LatencyMs",
    "avgTtftMs",
    "series",
    "topRoutes",
    "topModels",
    "activeKeys",
    "creditAlerts"
  ],
  "additionalProperties": false
}

GET /api/v1/reports/team

reports.team

مصرف هر نفر را از راه مالکیت کلیدها گزارش کنید، با یک دسته برای کلیدهای بدون مالک.

نقش
viewer
دامنه
usage:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "from": {
      "type": [
        "string",
        "null"
      ]
    },
    "to": {
      "type": [
        "string",
        "null"
      ]
    },
    "members": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "userId": {
            "type": [
              "string",
              "null"
            ]
          },
          "label": {
            "type": "string"
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "role": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "member",
                  "viewer",
                  "admin",
                  "owner"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "keys": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "requests": {
            "type": "number"
          },
          "totalTokens": {
            "type": "number"
          },
          "cachedTokens": {
            "type": "number"
          },
          "cost": {
            "type": "object",
            "properties": {
              "usd": {
                "type": "number"
              },
              "unpricedRequests": {
                "type": "number"
              },
              "subscriptionRequests": {
                "type": "number"
              },
              "requests": {
                "type": "number"
              }
            },
            "required": [
              "usd",
              "unpricedRequests",
              "subscriptionRequests",
              "requests"
            ],
            "additionalProperties": false
          },
          "avgLatencyMs": {
            "type": "number"
          }
        },
        "required": [
          "userId",
          "label",
          "email",
          "role",
          "keys",
          "requests",
          "totalTokens",
          "cachedTokens",
          "cost",
          "avgLatencyMs"
        ],
        "additionalProperties": false
      }
    },
    "total": {
      "type": "object",
      "properties": {
        "usd": {
          "type": "number"
        },
        "unpricedRequests": {
          "type": "number"
        },
        "subscriptionRequests": {
          "type": "number"
        },
        "requests": {
          "type": "number"
        }
      },
      "required": [
        "usd",
        "unpricedRequests",
        "subscriptionRequests",
        "requests"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "from",
    "to",
    "members",
    "total"
  ],
  "additionalProperties": false
}

GET /api/v1/reports/providers

reports.providers

هزینهٔ هر اعتبارنامهٔ ارائه‌دهنده را در برابر سقف اعلام‌شده و ظرفیت لحظه‌ای محدودیت نرخ گزارش کنید.

نقش
viewer
دامنه
usage:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "from": {
      "type": [
        "string",
        "null"
      ]
    },
    "to": {
      "type": [
        "string",
        "null"
      ]
    },
    "rows": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "credential": {
            "type": "string"
          },
          "provider": {
            "type": [
              "string",
              "null"
            ]
          },
          "models": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "requests": {
            "type": "number"
          },
          "totalTokens": {
            "type": "number"
          },
          "cost": {
            "type": "object",
            "properties": {
              "usd": {
                "type": "number"
              },
              "unpricedRequests": {
                "type": "number"
              },
              "subscriptionRequests": {
                "type": "number"
              },
              "requests": {
                "type": "number"
              }
            },
            "required": [
              "usd",
              "unpricedRequests",
              "subscriptionRequests",
              "requests"
            ],
            "additionalProperties": false
          },
          "limitUsd": {
            "type": [
              "number",
              "null"
            ]
          },
          "limitPeriod": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "month",
                  "30d"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "windowCost": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "usd": {
                    "type": "number"
                  },
                  "unpricedRequests": {
                    "type": "number"
                  },
                  "subscriptionRequests": {
                    "type": "number"
                  },
                  "requests": {
                    "type": "number"
                  }
                },
                "required": [
                  "usd",
                  "unpricedRequests",
                  "subscriptionRequests",
                  "requests"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "pctUsd": {
            "type": [
              "number",
              "null"
            ]
          },
          "headroom": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "pctLeft": {
                    "type": "number"
                  },
                  "tokensRemaining": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "tokensLimit": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "requestsRemaining": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "requestsLimit": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "capturedAt": {
                    "type": "string"
                  }
                },
                "required": [
                  "model",
                  "pctLeft",
                  "tokensRemaining",
                  "tokensLimit",
                  "requestsRemaining",
                  "requestsLimit",
                  "capturedAt"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "credential",
          "provider",
          "models",
          "requests",
          "totalTokens",
          "cost",
          "limitUsd",
          "limitPeriod",
          "windowCost",
          "pctUsd",
          "headroom"
        ],
        "additionalProperties": false
      }
    },
    "unattributed": {
      "type": "object",
      "properties": {
        "usd": {
          "type": "number"
        },
        "unpricedRequests": {
          "type": "number"
        },
        "subscriptionRequests": {
          "type": "number"
        },
        "requests": {
          "type": "number"
        }
      },
      "required": [
        "usd",
        "unpricedRequests",
        "subscriptionRequests",
        "requests"
      ],
      "additionalProperties": false
    },
    "total": {
      "type": "object",
      "properties": {
        "usd": {
          "type": "number"
        },
        "unpricedRequests": {
          "type": "number"
        },
        "subscriptionRequests": {
          "type": "number"
        },
        "requests": {
          "type": "number"
        }
      },
      "required": [
        "usd",
        "unpricedRequests",
        "subscriptionRequests",
        "requests"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "from",
    "to",
    "rows",
    "unattributed",
    "total"
  ],
  "additionalProperties": false
}

GET /api/v1/reports/developers

reports.developers

مصرف Claude Code هر توسعه‌دهنده را از تله‌متری خود کلاینت گزارش کنید. این عددها برآورد هستند، نه هزینه.

نقش
viewer
دامنه
usage:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "from": {
      "type": [
        "string",
        "null"
      ]
    },
    "to": {
      "type": [
        "string",
        "null"
      ]
    },
    "developers": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "developer": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "keyIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "clients": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sessions": {
            "type": "number"
          },
          "inputTokens": {
            "type": "number"
          },
          "outputTokens": {
            "type": "number"
          },
          "cacheReadTokens": {
            "type": "number"
          },
          "cacheCreationTokens": {
            "type": "number"
          },
          "totalTokens": {
            "type": "number"
          },
          "estimatedCostUsd": {
            "type": "number"
          },
          "linesAdded": {
            "type": "number"
          },
          "linesRemoved": {
            "type": "number"
          },
          "commits": {
            "type": "number"
          },
          "pullRequests": {
            "type": "number"
          },
          "activeSeconds": {
            "type": "number"
          },
          "models": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "model": {
                  "type": "string"
                },
                "totalTokens": {
                  "type": "number"
                }
              },
              "required": [
                "model",
                "totalTokens"
              ],
              "additionalProperties": false
            }
          },
          "gatewayRequests": {
            "type": "number"
          },
          "firstSeen": {
            "type": "string"
          },
          "lastSeen": {
            "type": "string"
          }
        },
        "required": [
          "developer",
          "name",
          "email",
          "keyIds",
          "clients",
          "sessions",
          "inputTokens",
          "outputTokens",
          "cacheReadTokens",
          "cacheCreationTokens",
          "totalTokens",
          "estimatedCostUsd",
          "linesAdded",
          "linesRemoved",
          "commits",
          "pullRequests",
          "activeSeconds",
          "models",
          "gatewayRequests",
          "firstSeen",
          "lastSeen"
        ],
        "additionalProperties": false
      }
    },
    "empty": {
      "type": "boolean"
    }
  },
  "required": [
    "from",
    "to",
    "developers",
    "empty"
  ],
  "additionalProperties": false
}

GET /api/v1/reports/hooks

reports.hooks

تصمیم‌های هوک‌های مدیریت‌شدهٔ Claude Code را گزارش کنید: ردها، کار بررسی‌نشده و قطعی‌های بررسی.

نقش
viewer
دامنه
usage:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "from": {
      "type": [
        "string",
        "null"
      ]
    },
    "to": {
      "type": [
        "string",
        "null"
      ]
    },
    "developers": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "developer": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "keyId": {
            "type": "string"
          },
          "events": {
            "type": "number"
          },
          "denials": {
            "type": "number"
          },
          "unscreened": {
            "type": "number"
          },
          "outages": {
            "type": "number"
          },
          "lastSeen": {
            "type": "string"
          }
        },
        "required": [
          "developer",
          "name",
          "keyId",
          "events",
          "denials",
          "unscreened",
          "outages",
          "lastSeen"
        ],
        "additionalProperties": false
      }
    },
    "recent": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "ts": {
            "type": "string"
          },
          "keyId": {
            "type": "string"
          },
          "sessionId": {
            "type": [
              "string",
              "null"
            ]
          },
          "event": {
            "type": "string",
            "enum": [
              "UserPromptSubmit",
              "PreToolUse",
              "PostToolUse"
            ]
          },
          "tool": {
            "type": [
              "string",
              "null"
            ]
          },
          "decision": {
            "type": "string",
            "enum": [
              "allow",
              "deny",
              "audit"
            ]
          },
          "screened": {
            "type": "boolean"
          },
          "guardAction": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "allow",
                  "flag",
                  "block"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "unscreenedReason": {
            "type": [
              "string",
              "null"
            ]
          },
          "guards": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "latencyMs": {
            "type": [
              "number",
              "null"
            ]
          },
          "attributes": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": [
                "string",
                "number",
                "boolean"
              ]
            }
          }
        },
        "required": [
          "ts",
          "keyId",
          "sessionId",
          "event",
          "tool",
          "decision",
          "screened",
          "guardAction",
          "unscreenedReason",
          "guards",
          "categories",
          "latencyMs",
          "attributes"
        ],
        "additionalProperties": false
      }
    },
    "totalOutages": {
      "type": "number"
    },
    "totalDenials": {
      "type": "number"
    }
  },
  "required": [
    "from",
    "to",
    "developers",
    "recent",
    "totalOutages",
    "totalDenials"
  ],
  "additionalProperties": false
}

GET /api/v1/reports/economics

reports.economics

اقتصاد هزینه را بخوانید: هزینه به تفکیک کلاینت، مدل و ابزار، با تجزیهٔ عامل‌ها و مسیر اشتراک.

نقش
viewer
دامنه
usage:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "reports": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "result": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "spec": {
                    "type": "object",
                    "properties": {
                      "source": {
                        "type": "string",
                        "enum": [
                          "requests",
                          "tool_calls",
                          "agent_metrics",
                          "outcomes"
                        ]
                      },
                      "dimensions": {
                        "maxItems": 2,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "enum": [
                            "client",
                            "model",
                            "route",
                            "subject",
                            "key",
                            "channel",
                            "tag",
                            "session",
                            "server",
                            "tool",
                            "repository",
                            "day",
                            "week",
                            "month"
                          ]
                        }
                      },
                      "measures": {
                        "minItems": 1,
                        "maxItems": 40,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "enum": [
                            "requests",
                            "input_tokens",
                            "output_tokens",
                            "total_tokens",
                            "cached_tokens",
                            "cost_usd",
                            "unpriced_requests",
                            "users",
                            "sessions",
                            "active_hours",
                            "latency_avg_ms",
                            "latency_p95_ms",
                            "ttft_avg_ms",
                            "cost_share",
                            "request_share",
                            "cost_per_user",
                            "requests_per_user",
                            "cost_per_1k_requests",
                            "tokens_per_request",
                            "cost_per_1m_tokens",
                            "cost_per_1k_sessions",
                            "cost_per_active_hour",
                            "cache_hit_rate",
                            "cost_decomposition",
                            "calls",
                            "ok",
                            "failed",
                            "unknown",
                            "denied",
                            "pending",
                            "unpriced_calls",
                            "cost_per_ok_call",
                            "operations",
                            "estimated_cost_usd",
                            "merged_prs",
                            "reverted_prs",
                            "revert_rate",
                            "reviews",
                            "joined_prs",
                            "cost_per_merged_pr"
                          ]
                        }
                      },
                      "filters": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string",
                          "enum": [
                            "client",
                            "model",
                            "route",
                            "subject",
                            "key",
                            "channel",
                            "tag",
                            "session",
                            "server",
                            "tool",
                            "repository",
                            "day",
                            "week",
                            "month"
                          ]
                        },
                        "additionalProperties": {
                          "maxItems": 50,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 200
                          }
                        }
                      },
                      "range": {
                        "anyOf": [
                          {
                            "type": "string",
                            "enum": [
                              "7d",
                              "30d",
                              "mtd",
                              "last_month"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "from": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "to": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "from",
                              "to"
                            ],
                            "additionalProperties": false
                          }
                        ]
                      },
                      "compare": {
                        "type": "string",
                        "enum": [
                          "none",
                          "previous_period"
                        ]
                      },
                      "view": {
                        "type": "string",
                        "enum": [
                          "table",
                          "bar",
                          "line",
                          "stacked",
                          "waterfall"
                        ]
                      }
                    },
                    "required": [
                      "source",
                      "dimensions",
                      "measures",
                      "filters",
                      "range",
                      "compare",
                      "view"
                    ],
                    "additionalProperties": false
                  },
                  "window": {
                    "type": "object",
                    "properties": {
                      "from": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "to": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "from",
                      "to"
                    ],
                    "additionalProperties": false
                  },
                  "previousWindow": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "from": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "to": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "from",
                          "to"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "rows": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "groups": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "current": {
                          "anyOf": [
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string",
                                "enum": [
                                  "requests",
                                  "input_tokens",
                                  "output_tokens",
                                  "total_tokens",
                                  "cached_tokens",
                                  "cost_usd",
                                  "unpriced_requests",
                                  "users",
                                  "sessions",
                                  "active_hours",
                                  "latency_avg_ms",
                                  "latency_p95_ms",
                                  "ttft_avg_ms",
                                  "cost_share",
                                  "request_share",
                                  "cost_per_user",
                                  "requests_per_user",
                                  "cost_per_1k_requests",
                                  "tokens_per_request",
                                  "cost_per_1m_tokens",
                                  "cost_per_1k_sessions",
                                  "cost_per_active_hour",
                                  "cache_hit_rate",
                                  "cost_decomposition",
                                  "calls",
                                  "ok",
                                  "failed",
                                  "unknown",
                                  "denied",
                                  "pending",
                                  "unpriced_calls",
                                  "cost_per_ok_call",
                                  "operations",
                                  "estimated_cost_usd",
                                  "merged_prs",
                                  "reverted_prs",
                                  "revert_rate",
                                  "reviews",
                                  "joined_prs",
                                  "cost_per_merged_pr"
                                ]
                              },
                              "additionalProperties": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              }
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "previous": {
                          "anyOf": [
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string",
                                "enum": [
                                  "requests",
                                  "input_tokens",
                                  "output_tokens",
                                  "total_tokens",
                                  "cached_tokens",
                                  "cost_usd",
                                  "unpriced_requests",
                                  "users",
                                  "sessions",
                                  "active_hours",
                                  "latency_avg_ms",
                                  "latency_p95_ms",
                                  "ttft_avg_ms",
                                  "cost_share",
                                  "request_share",
                                  "cost_per_user",
                                  "requests_per_user",
                                  "cost_per_1k_requests",
                                  "tokens_per_request",
                                  "cost_per_1m_tokens",
                                  "cost_per_1k_sessions",
                                  "cost_per_active_hour",
                                  "cache_hit_rate",
                                  "cost_decomposition",
                                  "calls",
                                  "ok",
                                  "failed",
                                  "unknown",
                                  "denied",
                                  "pending",
                                  "unpriced_calls",
                                  "cost_per_ok_call",
                                  "operations",
                                  "estimated_cost_usd",
                                  "merged_prs",
                                  "reverted_prs",
                                  "revert_rate",
                                  "reviews",
                                  "joined_prs",
                                  "cost_per_merged_pr"
                                ]
                              },
                              "additionalProperties": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              }
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "delta": {
                          "anyOf": [
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string",
                                "enum": [
                                  "requests",
                                  "input_tokens",
                                  "output_tokens",
                                  "total_tokens",
                                  "cached_tokens",
                                  "cost_usd",
                                  "unpriced_requests",
                                  "users",
                                  "sessions",
                                  "active_hours",
                                  "latency_avg_ms",
                                  "latency_p95_ms",
                                  "ttft_avg_ms",
                                  "cost_share",
                                  "request_share",
                                  "cost_per_user",
                                  "requests_per_user",
                                  "cost_per_1k_requests",
                                  "tokens_per_request",
                                  "cost_per_1m_tokens",
                                  "cost_per_1k_sessions",
                                  "cost_per_active_hour",
                                  "cache_hit_rate",
                                  "cost_decomposition",
                                  "calls",
                                  "ok",
                                  "failed",
                                  "unknown",
                                  "denied",
                                  "pending",
                                  "unpriced_calls",
                                  "cost_per_ok_call",
                                  "operations",
                                  "estimated_cost_usd",
                                  "merged_prs",
                                  "reverted_prs",
                                  "revert_rate",
                                  "reviews",
                                  "joined_prs",
                                  "cost_per_merged_pr"
                                ]
                              },
                              "additionalProperties": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              }
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "floor": {
                          "type": "boolean"
                        },
                        "previousFloor": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "groups",
                        "current",
                        "previous",
                        "delta",
                        "floor",
                        "previousFloor"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "total": {
                    "type": "object",
                    "properties": {
                      "groups": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "current": {
                        "anyOf": [
                          {
                            "type": "object",
                            "propertyNames": {
                              "type": "string",
                              "enum": [
                                "requests",
                                "input_tokens",
                                "output_tokens",
                                "total_tokens",
                                "cached_tokens",
                                "cost_usd",
                                "unpriced_requests",
                                "users",
                                "sessions",
                                "active_hours",
                                "latency_avg_ms",
                                "latency_p95_ms",
                                "ttft_avg_ms",
                                "cost_share",
                                "request_share",
                                "cost_per_user",
                                "requests_per_user",
                                "cost_per_1k_requests",
                                "tokens_per_request",
                                "cost_per_1m_tokens",
                                "cost_per_1k_sessions",
                                "cost_per_active_hour",
                                "cache_hit_rate",
                                "cost_decomposition",
                                "calls",
                                "ok",
                                "failed",
                                "unknown",
                                "denied",
                                "pending",
                                "unpriced_calls",
                                "cost_per_ok_call",
                                "operations",
                                "estimated_cost_usd",
                                "merged_prs",
                                "reverted_prs",
                                "revert_rate",
                                "reviews",
                                "joined_prs",
                                "cost_per_merged_pr"
                              ]
                            },
                            "additionalProperties": {
                              "type": [
                                "number",
                                "null"
                              ]
                            }
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "previous": {
                        "anyOf": [
                          {
                            "type": "object",
                            "propertyNames": {
                              "type": "string",
                              "enum": [
                                "requests",
                                "input_tokens",
                                "output_tokens",
                                "total_tokens",
                                "cached_tokens",
                                "cost_usd",
                                "unpriced_requests",
                                "users",
                                "sessions",
                                "active_hours",
                                "latency_avg_ms",
                                "latency_p95_ms",
                                "ttft_avg_ms",
                                "cost_share",
                                "request_share",
                                "cost_per_user",
                                "requests_per_user",
                                "cost_per_1k_requests",
                                "tokens_per_request",
                                "cost_per_1m_tokens",
                                "cost_per_1k_sessions",
                                "cost_per_active_hour",
                                "cache_hit_rate",
                                "cost_decomposition",
                                "calls",
                                "ok",
                                "failed",
                                "unknown",
                                "denied",
                                "pending",
                                "unpriced_calls",
                                "cost_per_ok_call",
                                "operations",
                                "estimated_cost_usd",
                                "merged_prs",
                                "reverted_prs",
                                "revert_rate",
                                "reviews",
                                "joined_prs",
                                "cost_per_merged_pr"
                              ]
                            },
                            "additionalProperties": {
                              "type": [
                                "number",
                                "null"
                              ]
                            }
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "delta": {
                        "anyOf": [
                          {
                            "type": "object",
                            "propertyNames": {
                              "type": "string",
                              "enum": [
                                "requests",
                                "input_tokens",
                                "output_tokens",
                                "total_tokens",
                                "cached_tokens",
                                "cost_usd",
                                "unpriced_requests",
                                "users",
                                "sessions",
                                "active_hours",
                                "latency_avg_ms",
                                "latency_p95_ms",
                                "ttft_avg_ms",
                                "cost_share",
                                "request_share",
                                "cost_per_user",
                                "requests_per_user",
                                "cost_per_1k_requests",
                                "tokens_per_request",
                                "cost_per_1m_tokens",
                                "cost_per_1k_sessions",
                                "cost_per_active_hour",
                                "cache_hit_rate",
                                "cost_decomposition",
                                "calls",
                                "ok",
                                "failed",
                                "unknown",
                                "denied",
                                "pending",
                                "unpriced_calls",
                                "cost_per_ok_call",
                                "operations",
                                "estimated_cost_usd",
                                "merged_prs",
                                "reverted_prs",
                                "revert_rate",
                                "reviews",
                                "joined_prs",
                                "cost_per_merged_pr"
                              ]
                            },
                            "additionalProperties": {
                              "type": [
                                "number",
                                "null"
                              ]
                            }
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "floor": {
                        "type": "boolean"
                      },
                      "previousFloor": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "groups",
                      "current",
                      "previous",
                      "delta",
                      "floor",
                      "previousFloor"
                    ],
                    "additionalProperties": false
                  },
                  "decomposition": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "previousUsd": {
                            "type": "number"
                          },
                          "currentUsd": {
                            "type": "number"
                          },
                          "deltaUsd": {
                            "type": "number"
                          },
                          "parts": {
                            "type": "object",
                            "properties": {
                              "users": {
                                "type": "number"
                              },
                              "requestsPerUser": {
                                "type": "number"
                              },
                              "inputTokensPerRequest": {
                                "type": "number"
                              },
                              "outputTokensPerRequest": {
                                "type": "number"
                              },
                              "pricePerToken": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "users",
                              "requestsPerUser",
                              "inputTokensPerRequest",
                              "outputTokensPerRequest",
                              "pricePerToken"
                            ],
                            "additionalProperties": false
                          },
                          "unmodelledUsd": {
                            "type": "number"
                          },
                          "floor": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "previousUsd",
                          "currentUsd",
                          "deltaUsd",
                          "parts",
                          "unmodelledUsd",
                          "floor"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "coverage": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "dimensionsSince": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "rowsBefore": {
                            "type": "number"
                          },
                          "previousRowsBefore": {
                            "type": [
                              "number",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "dimensionsSince",
                          "rowsBefore",
                          "previousRowsBefore"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "spec",
                  "window",
                  "previousWindow",
                  "rows",
                  "total",
                  "decomposition",
                  "coverage"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "title",
          "description",
          "result"
        ],
        "additionalProperties": false
      }
    },
    "subscription": {
      "type": "object",
      "properties": {
        "spec": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string",
              "enum": [
                "requests",
                "tool_calls",
                "agent_metrics",
                "outcomes"
              ]
            },
            "dimensions": {
              "maxItems": 2,
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "client",
                  "model",
                  "route",
                  "subject",
                  "key",
                  "channel",
                  "tag",
                  "session",
                  "server",
                  "tool",
                  "repository",
                  "day",
                  "week",
                  "month"
                ]
              }
            },
            "measures": {
              "minItems": 1,
              "maxItems": 40,
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "requests",
                  "input_tokens",
                  "output_tokens",
                  "total_tokens",
                  "cached_tokens",
                  "cost_usd",
                  "unpriced_requests",
                  "users",
                  "sessions",
                  "active_hours",
                  "latency_avg_ms",
                  "latency_p95_ms",
                  "ttft_avg_ms",
                  "cost_share",
                  "request_share",
                  "cost_per_user",
                  "requests_per_user",
                  "cost_per_1k_requests",
                  "tokens_per_request",
                  "cost_per_1m_tokens",
                  "cost_per_1k_sessions",
                  "cost_per_active_hour",
                  "cache_hit_rate",
                  "cost_decomposition",
                  "calls",
                  "ok",
                  "failed",
                  "unknown",
                  "denied",
                  "pending",
                  "unpriced_calls",
                  "cost_per_ok_call",
                  "operations",
                  "estimated_cost_usd",
                  "merged_prs",
                  "reverted_prs",
                  "revert_rate",
                  "reviews",
                  "joined_prs",
                  "cost_per_merged_pr"
                ]
              }
            },
            "filters": {
              "type": "object",
              "propertyNames": {
                "type": "string",
                "enum": [
                  "client",
                  "model",
                  "route",
                  "subject",
                  "key",
                  "channel",
                  "tag",
                  "session",
                  "server",
                  "tool",
                  "repository",
                  "day",
                  "week",
                  "month"
                ]
              },
              "additionalProperties": {
                "maxItems": 50,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200
                }
              }
            },
            "range": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "7d",
                    "30d",
                    "mtd",
                    "last_month"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "from": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "to": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "from",
                    "to"
                  ],
                  "additionalProperties": false
                }
              ]
            },
            "compare": {
              "type": "string",
              "enum": [
                "none",
                "previous_period"
              ]
            },
            "view": {
              "type": "string",
              "enum": [
                "table",
                "bar",
                "line",
                "stacked",
                "waterfall"
              ]
            }
          },
          "required": [
            "source",
            "dimensions",
            "measures",
            "filters",
            "range",
            "compare",
            "view"
          ],
          "additionalProperties": false
        },
        "window": {
          "type": "object",
          "properties": {
            "from": {
              "type": [
                "string",
                "null"
              ]
            },
            "to": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "from",
            "to"
          ],
          "additionalProperties": false
        },
        "previousWindow": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "from": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "to": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "from",
                "to"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "rows": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "groups": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "current": {
                "anyOf": [
                  {
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "enum": [
                        "requests",
                        "input_tokens",
                        "output_tokens",
                        "total_tokens",
                        "cached_tokens",
                        "cost_usd",
                        "unpriced_requests",
                        "users",
                        "sessions",
                        "active_hours",
                        "latency_avg_ms",
                        "latency_p95_ms",
                        "ttft_avg_ms",
                        "cost_share",
                        "request_share",
                        "cost_per_user",
                        "requests_per_user",
                        "cost_per_1k_requests",
                        "tokens_per_request",
                        "cost_per_1m_tokens",
                        "cost_per_1k_sessions",
                        "cost_per_active_hour",
                        "cache_hit_rate",
                        "cost_decomposition",
                        "calls",
                        "ok",
                        "failed",
                        "unknown",
                        "denied",
                        "pending",
                        "unpriced_calls",
                        "cost_per_ok_call",
                        "operations",
                        "estimated_cost_usd",
                        "merged_prs",
                        "reverted_prs",
                        "revert_rate",
                        "reviews",
                        "joined_prs",
                        "cost_per_merged_pr"
                      ]
                    },
                    "additionalProperties": {
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "previous": {
                "anyOf": [
                  {
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "enum": [
                        "requests",
                        "input_tokens",
                        "output_tokens",
                        "total_tokens",
                        "cached_tokens",
                        "cost_usd",
                        "unpriced_requests",
                        "users",
                        "sessions",
                        "active_hours",
                        "latency_avg_ms",
                        "latency_p95_ms",
                        "ttft_avg_ms",
                        "cost_share",
                        "request_share",
                        "cost_per_user",
                        "requests_per_user",
                        "cost_per_1k_requests",
                        "tokens_per_request",
                        "cost_per_1m_tokens",
                        "cost_per_1k_sessions",
                        "cost_per_active_hour",
                        "cache_hit_rate",
                        "cost_decomposition",
                        "calls",
                        "ok",
                        "failed",
                        "unknown",
                        "denied",
                        "pending",
                        "unpriced_calls",
                        "cost_per_ok_call",
                        "operations",
                        "estimated_cost_usd",
                        "merged_prs",
                        "reverted_prs",
                        "revert_rate",
                        "reviews",
                        "joined_prs",
                        "cost_per_merged_pr"
                      ]
                    },
                    "additionalProperties": {
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "delta": {
                "anyOf": [
                  {
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "enum": [
                        "requests",
                        "input_tokens",
                        "output_tokens",
                        "total_tokens",
                        "cached_tokens",
                        "cost_usd",
                        "unpriced_requests",
                        "users",
                        "sessions",
                        "active_hours",
                        "latency_avg_ms",
                        "latency_p95_ms",
                        "ttft_avg_ms",
                        "cost_share",
                        "request_share",
                        "cost_per_user",
                        "requests_per_user",
                        "cost_per_1k_requests",
                        "tokens_per_request",
                        "cost_per_1m_tokens",
                        "cost_per_1k_sessions",
                        "cost_per_active_hour",
                        "cache_hit_rate",
                        "cost_decomposition",
                        "calls",
                        "ok",
                        "failed",
                        "unknown",
                        "denied",
                        "pending",
                        "unpriced_calls",
                        "cost_per_ok_call",
                        "operations",
                        "estimated_cost_usd",
                        "merged_prs",
                        "reverted_prs",
                        "revert_rate",
                        "reviews",
                        "joined_prs",
                        "cost_per_merged_pr"
                      ]
                    },
                    "additionalProperties": {
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "floor": {
                "type": "boolean"
              },
              "previousFloor": {
                "type": "boolean"
              }
            },
            "required": [
              "groups",
              "current",
              "previous",
              "delta",
              "floor",
              "previousFloor"
            ],
            "additionalProperties": false
          }
        },
        "total": {
          "type": "object",
          "properties": {
            "groups": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "current": {
              "anyOf": [
                {
                  "type": "object",
                  "propertyNames": {
                    "type": "string",
                    "enum": [
                      "requests",
                      "input_tokens",
                      "output_tokens",
                      "total_tokens",
                      "cached_tokens",
                      "cost_usd",
                      "unpriced_requests",
                      "users",
                      "sessions",
                      "active_hours",
                      "latency_avg_ms",
                      "latency_p95_ms",
                      "ttft_avg_ms",
                      "cost_share",
                      "request_share",
                      "cost_per_user",
                      "requests_per_user",
                      "cost_per_1k_requests",
                      "tokens_per_request",
                      "cost_per_1m_tokens",
                      "cost_per_1k_sessions",
                      "cost_per_active_hour",
                      "cache_hit_rate",
                      "cost_decomposition",
                      "calls",
                      "ok",
                      "failed",
                      "unknown",
                      "denied",
                      "pending",
                      "unpriced_calls",
                      "cost_per_ok_call",
                      "operations",
                      "estimated_cost_usd",
                      "merged_prs",
                      "reverted_prs",
                      "revert_rate",
                      "reviews",
                      "joined_prs",
                      "cost_per_merged_pr"
                    ]
                  },
                  "additionalProperties": {
                    "type": [
                      "number",
                      "null"
                    ]
                  }
                },
                {
                  "type": "null"
                }
              ]
            },
            "previous": {
              "anyOf": [
                {
                  "type": "object",
                  "propertyNames": {
                    "type": "string",
                    "enum": [
                      "requests",
                      "input_tokens",
                      "output_tokens",
                      "total_tokens",
                      "cached_tokens",
                      "cost_usd",
                      "unpriced_requests",
                      "users",
                      "sessions",
                      "active_hours",
                      "latency_avg_ms",
                      "latency_p95_ms",
                      "ttft_avg_ms",
                      "cost_share",
                      "request_share",
                      "cost_per_user",
                      "requests_per_user",
                      "cost_per_1k_requests",
                      "tokens_per_request",
                      "cost_per_1m_tokens",
                      "cost_per_1k_sessions",
                      "cost_per_active_hour",
                      "cache_hit_rate",
                      "cost_decomposition",
                      "calls",
                      "ok",
                      "failed",
                      "unknown",
                      "denied",
                      "pending",
                      "unpriced_calls",
                      "cost_per_ok_call",
                      "operations",
                      "estimated_cost_usd",
                      "merged_prs",
                      "reverted_prs",
                      "revert_rate",
                      "reviews",
                      "joined_prs",
                      "cost_per_merged_pr"
                    ]
                  },
                  "additionalProperties": {
                    "type": [
                      "number",
                      "null"
                    ]
                  }
                },
                {
                  "type": "null"
                }
              ]
            },
            "delta": {
              "anyOf": [
                {
                  "type": "object",
                  "propertyNames": {
                    "type": "string",
                    "enum": [
                      "requests",
                      "input_tokens",
                      "output_tokens",
                      "total_tokens",
                      "cached_tokens",
                      "cost_usd",
                      "unpriced_requests",
                      "users",
                      "sessions",
                      "active_hours",
                      "latency_avg_ms",
                      "latency_p95_ms",
                      "ttft_avg_ms",
                      "cost_share",
                      "request_share",
                      "cost_per_user",
                      "requests_per_user",
                      "cost_per_1k_requests",
                      "tokens_per_request",
                      "cost_per_1m_tokens",
                      "cost_per_1k_sessions",
                      "cost_per_active_hour",
                      "cache_hit_rate",
                      "cost_decomposition",
                      "calls",
                      "ok",
                      "failed",
                      "unknown",
                      "denied",
                      "pending",
                      "unpriced_calls",
                      "cost_per_ok_call",
                      "operations",
                      "estimated_cost_usd",
                      "merged_prs",
                      "reverted_prs",
                      "revert_rate",
                      "reviews",
                      "joined_prs",
                      "cost_per_merged_pr"
                    ]
                  },
                  "additionalProperties": {
                    "type": [
                      "number",
                      "null"
                    ]
                  }
                },
                {
                  "type": "null"
                }
              ]
            },
            "floor": {
              "type": "boolean"
            },
            "previousFloor": {
              "type": "boolean"
            }
          },
          "required": [
            "groups",
            "current",
            "previous",
            "delta",
            "floor",
            "previousFloor"
          ],
          "additionalProperties": false
        },
        "decomposition": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "previousUsd": {
                  "type": "number"
                },
                "currentUsd": {
                  "type": "number"
                },
                "deltaUsd": {
                  "type": "number"
                },
                "parts": {
                  "type": "object",
                  "properties": {
                    "users": {
                      "type": "number"
                    },
                    "requestsPerUser": {
                      "type": "number"
                    },
                    "inputTokensPerRequest": {
                      "type": "number"
                    },
                    "outputTokensPerRequest": {
                      "type": "number"
                    },
                    "pricePerToken": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "users",
                    "requestsPerUser",
                    "inputTokensPerRequest",
                    "outputTokensPerRequest",
                    "pricePerToken"
                  ],
                  "additionalProperties": false
                },
                "unmodelledUsd": {
                  "type": "number"
                },
                "floor": {
                  "type": "boolean"
                }
              },
              "required": [
                "previousUsd",
                "currentUsd",
                "deltaUsd",
                "parts",
                "unmodelledUsd",
                "floor"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "coverage": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "dimensionsSince": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "rowsBefore": {
                  "type": "number"
                },
                "previousRowsBefore": {
                  "type": [
                    "number",
                    "null"
                  ]
                }
              },
              "required": [
                "dimensionsSince",
                "rowsBefore",
                "previousRowsBefore"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "spec",
        "window",
        "previousWindow",
        "rows",
        "total",
        "decomposition",
        "coverage"
      ],
      "additionalProperties": false
    },
    "agentEstimate": {
      "type": "object",
      "properties": {
        "spec": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string",
              "enum": [
                "requests",
                "tool_calls",
                "agent_metrics",
                "outcomes"
              ]
            },
            "dimensions": {
              "maxItems": 2,
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "client",
                  "model",
                  "route",
                  "subject",
                  "key",
                  "channel",
                  "tag",
                  "session",
                  "server",
                  "tool",
                  "repository",
                  "day",
                  "week",
                  "month"
                ]
              }
            },
            "measures": {
              "minItems": 1,
              "maxItems": 40,
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "requests",
                  "input_tokens",
                  "output_tokens",
                  "total_tokens",
                  "cached_tokens",
                  "cost_usd",
                  "unpriced_requests",
                  "users",
                  "sessions",
                  "active_hours",
                  "latency_avg_ms",
                  "latency_p95_ms",
                  "ttft_avg_ms",
                  "cost_share",
                  "request_share",
                  "cost_per_user",
                  "requests_per_user",
                  "cost_per_1k_requests",
                  "tokens_per_request",
                  "cost_per_1m_tokens",
                  "cost_per_1k_sessions",
                  "cost_per_active_hour",
                  "cache_hit_rate",
                  "cost_decomposition",
                  "calls",
                  "ok",
                  "failed",
                  "unknown",
                  "denied",
                  "pending",
                  "unpriced_calls",
                  "cost_per_ok_call",
                  "operations",
                  "estimated_cost_usd",
                  "merged_prs",
                  "reverted_prs",
                  "revert_rate",
                  "reviews",
                  "joined_prs",
                  "cost_per_merged_pr"
                ]
              }
            },
            "filters": {
              "type": "object",
              "propertyNames": {
                "type": "string",
                "enum": [
                  "client",
                  "model",
                  "route",
                  "subject",
                  "key",
                  "channel",
                  "tag",
                  "session",
                  "server",
                  "tool",
                  "repository",
                  "day",
                  "week",
                  "month"
                ]
              },
              "additionalProperties": {
                "maxItems": 50,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200
                }
              }
            },
            "range": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "7d",
                    "30d",
                    "mtd",
                    "last_month"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "from": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "to": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "from",
                    "to"
                  ],
                  "additionalProperties": false
                }
              ]
            },
            "compare": {
              "type": "string",
              "enum": [
                "none",
                "previous_period"
              ]
            },
            "view": {
              "type": "string",
              "enum": [
                "table",
                "bar",
                "line",
                "stacked",
                "waterfall"
              ]
            }
          },
          "required": [
            "source",
            "dimensions",
            "measures",
            "filters",
            "range",
            "compare",
            "view"
          ],
          "additionalProperties": false
        },
        "window": {
          "type": "object",
          "properties": {
            "from": {
              "type": [
                "string",
                "null"
              ]
            },
            "to": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "from",
            "to"
          ],
          "additionalProperties": false
        },
        "previousWindow": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "from": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "to": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "from",
                "to"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "rows": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "groups": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "current": {
                "anyOf": [
                  {
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "enum": [
                        "requests",
                        "input_tokens",
                        "output_tokens",
                        "total_tokens",
                        "cached_tokens",
                        "cost_usd",
                        "unpriced_requests",
                        "users",
                        "sessions",
                        "active_hours",
                        "latency_avg_ms",
                        "latency_p95_ms",
                        "ttft_avg_ms",
                        "cost_share",
                        "request_share",
                        "cost_per_user",
                        "requests_per_user",
                        "cost_per_1k_requests",
                        "tokens_per_request",
                        "cost_per_1m_tokens",
                        "cost_per_1k_sessions",
                        "cost_per_active_hour",
                        "cache_hit_rate",
                        "cost_decomposition",
                        "calls",
                        "ok",
                        "failed",
                        "unknown",
                        "denied",
                        "pending",
                        "unpriced_calls",
                        "cost_per_ok_call",
                        "operations",
                        "estimated_cost_usd",
                        "merged_prs",
                        "reverted_prs",
                        "revert_rate",
                        "reviews",
                        "joined_prs",
                        "cost_per_merged_pr"
                      ]
                    },
                    "additionalProperties": {
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "previous": {
                "anyOf": [
                  {
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "enum": [
                        "requests",
                        "input_tokens",
                        "output_tokens",
                        "total_tokens",
                        "cached_tokens",
                        "cost_usd",
                        "unpriced_requests",
                        "users",
                        "sessions",
                        "active_hours",
                        "latency_avg_ms",
                        "latency_p95_ms",
                        "ttft_avg_ms",
                        "cost_share",
                        "request_share",
                        "cost_per_user",
                        "requests_per_user",
                        "cost_per_1k_requests",
                        "tokens_per_request",
                        "cost_per_1m_tokens",
                        "cost_per_1k_sessions",
                        "cost_per_active_hour",
                        "cache_hit_rate",
                        "cost_decomposition",
                        "calls",
                        "ok",
                        "failed",
                        "unknown",
                        "denied",
                        "pending",
                        "unpriced_calls",
                        "cost_per_ok_call",
                        "operations",
                        "estimated_cost_usd",
                        "merged_prs",
                        "reverted_prs",
                        "revert_rate",
                        "reviews",
                        "joined_prs",
                        "cost_per_merged_pr"
                      ]
                    },
                    "additionalProperties": {
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "delta": {
                "anyOf": [
                  {
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "enum": [
                        "requests",
                        "input_tokens",
                        "output_tokens",
                        "total_tokens",
                        "cached_tokens",
                        "cost_usd",
                        "unpriced_requests",
                        "users",
                        "sessions",
                        "active_hours",
                        "latency_avg_ms",
                        "latency_p95_ms",
                        "ttft_avg_ms",
                        "cost_share",
                        "request_share",
                        "cost_per_user",
                        "requests_per_user",
                        "cost_per_1k_requests",
                        "tokens_per_request",
                        "cost_per_1m_tokens",
                        "cost_per_1k_sessions",
                        "cost_per_active_hour",
                        "cache_hit_rate",
                        "cost_decomposition",
                        "calls",
                        "ok",
                        "failed",
                        "unknown",
                        "denied",
                        "pending",
                        "unpriced_calls",
                        "cost_per_ok_call",
                        "operations",
                        "estimated_cost_usd",
                        "merged_prs",
                        "reverted_prs",
                        "revert_rate",
                        "reviews",
                        "joined_prs",
                        "cost_per_merged_pr"
                      ]
                    },
                    "additionalProperties": {
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "floor": {
                "type": "boolean"
              },
              "previousFloor": {
                "type": "boolean"
              }
            },
            "required": [
              "groups",
              "current",
              "previous",
              "delta",
              "floor",
              "previousFloor"
            ],
            "additionalProperties": false
          }
        },
        "total": {
          "type": "object",
          "properties": {
            "groups": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "current": {
              "anyOf": [
                {
                  "type": "object",
                  "propertyNames": {
                    "type": "string",
                    "enum": [
                      "requests",
                      "input_tokens",
                      "output_tokens",
                      "total_tokens",
                      "cached_tokens",
                      "cost_usd",
                      "unpriced_requests",
                      "users",
                      "sessions",
                      "active_hours",
                      "latency_avg_ms",
                      "latency_p95_ms",
                      "ttft_avg_ms",
                      "cost_share",
                      "request_share",
                      "cost_per_user",
                      "requests_per_user",
                      "cost_per_1k_requests",
                      "tokens_per_request",
                      "cost_per_1m_tokens",
                      "cost_per_1k_sessions",
                      "cost_per_active_hour",
                      "cache_hit_rate",
                      "cost_decomposition",
                      "calls",
                      "ok",
                      "failed",
                      "unknown",
                      "denied",
                      "pending",
                      "unpriced_calls",
                      "cost_per_ok_call",
                      "operations",
                      "estimated_cost_usd",
                      "merged_prs",
                      "reverted_prs",
                      "revert_rate",
                      "reviews",
                      "joined_prs",
                      "cost_per_merged_pr"
                    ]
                  },
                  "additionalProperties": {
                    "type": [
                      "number",
                      "null"
                    ]
                  }
                },
                {
                  "type": "null"
                }
              ]
            },
            "previous": {
              "anyOf": [
                {
                  "type": "object",
                  "propertyNames": {
                    "type": "string",
                    "enum": [
                      "requests",
                      "input_tokens",
                      "output_tokens",
                      "total_tokens",
                      "cached_tokens",
                      "cost_usd",
                      "unpriced_requests",
                      "users",
                      "sessions",
                      "active_hours",
                      "latency_avg_ms",
                      "latency_p95_ms",
                      "ttft_avg_ms",
                      "cost_share",
                      "request_share",
                      "cost_per_user",
                      "requests_per_user",
                      "cost_per_1k_requests",
                      "tokens_per_request",
                      "cost_per_1m_tokens",
                      "cost_per_1k_sessions",
                      "cost_per_active_hour",
                      "cache_hit_rate",
                      "cost_decomposition",
                      "calls",
                      "ok",
                      "failed",
                      "unknown",
                      "denied",
                      "pending",
                      "unpriced_calls",
                      "cost_per_ok_call",
                      "operations",
                      "estimated_cost_usd",
                      "merged_prs",
                      "reverted_prs",
                      "revert_rate",
                      "reviews",
                      "joined_prs",
                      "cost_per_merged_pr"
                    ]
                  },
                  "additionalProperties": {
                    "type": [
                      "number",
                      "null"
                    ]
                  }
                },
                {
                  "type": "null"
                }
              ]
            },
            "delta": {
              "anyOf": [
                {
                  "type": "object",
                  "propertyNames": {
                    "type": "string",
                    "enum": [
                      "requests",
                      "input_tokens",
                      "output_tokens",
                      "total_tokens",
                      "cached_tokens",
                      "cost_usd",
                      "unpriced_requests",
                      "users",
                      "sessions",
                      "active_hours",
                      "latency_avg_ms",
                      "latency_p95_ms",
                      "ttft_avg_ms",
                      "cost_share",
                      "request_share",
                      "cost_per_user",
                      "requests_per_user",
                      "cost_per_1k_requests",
                      "tokens_per_request",
                      "cost_per_1m_tokens",
                      "cost_per_1k_sessions",
                      "cost_per_active_hour",
                      "cache_hit_rate",
                      "cost_decomposition",
                      "calls",
                      "ok",
                      "failed",
                      "unknown",
                      "denied",
                      "pending",
                      "unpriced_calls",
                      "cost_per_ok_call",
                      "operations",
                      "estimated_cost_usd",
                      "merged_prs",
                      "reverted_prs",
                      "revert_rate",
                      "reviews",
                      "joined_prs",
                      "cost_per_merged_pr"
                    ]
                  },
                  "additionalProperties": {
                    "type": [
                      "number",
                      "null"
                    ]
                  }
                },
                {
                  "type": "null"
                }
              ]
            },
            "floor": {
              "type": "boolean"
            },
            "previousFloor": {
              "type": "boolean"
            }
          },
          "required": [
            "groups",
            "current",
            "previous",
            "delta",
            "floor",
            "previousFloor"
          ],
          "additionalProperties": false
        },
        "decomposition": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "previousUsd": {
                  "type": "number"
                },
                "currentUsd": {
                  "type": "number"
                },
                "deltaUsd": {
                  "type": "number"
                },
                "parts": {
                  "type": "object",
                  "properties": {
                    "users": {
                      "type": "number"
                    },
                    "requestsPerUser": {
                      "type": "number"
                    },
                    "inputTokensPerRequest": {
                      "type": "number"
                    },
                    "outputTokensPerRequest": {
                      "type": "number"
                    },
                    "pricePerToken": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "users",
                    "requestsPerUser",
                    "inputTokensPerRequest",
                    "outputTokensPerRequest",
                    "pricePerToken"
                  ],
                  "additionalProperties": false
                },
                "unmodelledUsd": {
                  "type": "number"
                },
                "floor": {
                  "type": "boolean"
                }
              },
              "required": [
                "previousUsd",
                "currentUsd",
                "deltaUsd",
                "parts",
                "unmodelledUsd",
                "floor"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "coverage": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "dimensionsSince": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "rowsBefore": {
                  "type": "number"
                },
                "previousRowsBefore": {
                  "type": [
                    "number",
                    "null"
                  ]
                }
              },
              "required": [
                "dimensionsSince",
                "rowsBefore",
                "previousRowsBefore"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "spec",
        "window",
        "previousWindow",
        "rows",
        "total",
        "decomposition",
        "coverage"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "reports",
    "subscription",
    "agentEstimate"
  ],
  "additionalProperties": false
}

GET /api/v1/reports/tool-calls

reports.tool-calls

فراخوانی‌های ابزار از راه /mcp را به تفکیک ابزار، سرور، شخص یا کلید گزارش کنید: تعداد، نتیجه، رد، هزینه و تأخیر.

نقش
viewer
دامنه
usage:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "groupBy": {
      "type": "string",
      "enum": [
        "tool",
        "server",
        "person",
        "key"
      ]
    },
    "from": {
      "type": [
        "string",
        "null"
      ]
    },
    "to": {
      "type": [
        "string",
        "null"
      ]
    },
    "rows": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "group": {
            "type": "string"
          },
          "calls": {
            "type": "number"
          },
          "dispatched": {
            "type": "number"
          },
          "denied": {
            "type": "number"
          },
          "pending": {
            "type": "number"
          },
          "failed": {
            "type": "number"
          },
          "unknown": {
            "type": "number"
          },
          "costUsd": {
            "type": "number"
          },
          "unpricedCalls": {
            "type": "number"
          },
          "avgLatencyMs": {
            "type": [
              "number",
              "null"
            ]
          },
          "p95LatencyMs": {
            "type": [
              "number",
              "null"
            ]
          },
          "subjectName": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "group",
          "calls",
          "dispatched",
          "denied",
          "pending",
          "failed",
          "unknown",
          "costUsd",
          "unpricedCalls",
          "avgLatencyMs",
          "p95LatencyMs",
          "subjectName"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "groupBy",
    "from",
    "to",
    "rows"
  ],
  "additionalProperties": false
}

GET /api/v1/reports/agent-metrics

reports.agent-metrics

مصرفی را که خود عامل‌ها گزارش کرده‌اند به تفکیک کلاینت، مدل، شخص، نشست، کلید یا کاربر گزارش کنید. این عدد هزینه نیست.

نقش
viewer
دامنه
usage:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "groupBy": {
      "type": "string",
      "enum": [
        "client",
        "model",
        "subject",
        "session",
        "key",
        "user"
      ]
    },
    "from": {
      "type": [
        "string",
        "null"
      ]
    },
    "to": {
      "type": [
        "string",
        "null"
      ]
    },
    "rows": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "group": {
            "type": "string"
          },
          "operations": {
            "type": "number"
          },
          "operationSeconds": {
            "type": "number"
          },
          "inputTokens": {
            "type": "number"
          },
          "outputTokens": {
            "type": "number"
          },
          "totalTokens": {
            "type": "number"
          },
          "sessions": {
            "type": "number"
          },
          "estimatedCostUsd": {
            "type": "number"
          },
          "subjectName": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "group",
          "operations",
          "operationSeconds",
          "inputTokens",
          "outputTokens",
          "totalTokens",
          "sessions",
          "estimatedCostUsd",
          "subjectName"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "groupBy",
    "from",
    "to",
    "rows"
  ],
  "additionalProperties": false
}

GET /api/v1/reports/security

reports.security

رویدادهای امنیتی را گزارش کنید: درخواست‌های ردشده و ناموفق و مدخل‌های امنیتی گزارش ممیزی.

نقش
owner
دامنه
audit:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "from": {
      "type": [
        "string",
        "null"
      ]
    },
    "to": {
      "type": [
        "string",
        "null"
      ]
    },
    "blocked": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "route": {
            "type": "string"
          },
          "keyId": {
            "type": "string"
          },
          "requests": {
            "type": "number"
          },
          "lastSeen": {
            "type": "string"
          }
        },
        "required": [
          "status",
          "route",
          "keyId",
          "requests",
          "lastSeen"
        ],
        "additionalProperties": false
      }
    },
    "counts": {
      "type": "object",
      "properties": {
        "unauthorized": {
          "type": "number"
        },
        "forbidden": {
          "type": "number"
        },
        "rateLimited": {
          "type": "number"
        },
        "upstreamErrors": {
          "type": "number"
        }
      },
      "required": [
        "unauthorized",
        "forbidden",
        "rateLimited",
        "upstreamErrors"
      ],
      "additionalProperties": false
    },
    "audit": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number"
          },
          "ts": {
            "type": "string"
          },
          "actorType": {
            "type": "string",
            "enum": [
              "user",
              "token"
            ]
          },
          "actorUserId": {
            "type": [
              "string",
              "null"
            ]
          },
          "actorEmail": {
            "type": [
              "string",
              "null"
            ]
          },
          "actorTokenId": {
            "type": [
              "string",
              "null"
            ]
          },
          "action": {
            "type": "string"
          },
          "resourceType": {
            "type": [
              "string",
              "null"
            ]
          },
          "resourceId": {
            "type": [
              "string",
              "null"
            ]
          },
          "before": {},
          "after": {},
          "ip": {
            "type": [
              "string",
              "null"
            ]
          },
          "userAgent": {
            "type": [
              "string",
              "null"
            ]
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "reasonCategory": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "ts",
          "actorType",
          "actorUserId",
          "actorEmail",
          "actorTokenId",
          "action",
          "resourceType",
          "resourceId",
          "before",
          "after",
          "ip",
          "userAgent",
          "reason",
          "reasonCategory"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "from",
    "to",
    "blocked",
    "counts",
    "audit"
  ],
  "additionalProperties": false
}

GET /api/v1/status

status.read

وضعیت هر مدل را بخوانید: فعال، کند، از کار افتاده یا نامعلوم، با ترافیک، خطا و تأخیر اخیر.

نقش
viewer
دامنه
usage:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "models": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string"
          },
          "providerModel": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "credential": {
            "type": [
              "string",
              "null"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "up",
              "degraded",
              "down",
              "unknown"
            ]
          },
          "probeHealthy": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "probeError": {
            "type": [
              "string",
              "null"
            ]
          },
          "requests": {
            "type": "number"
          },
          "errorRate": {
            "type": [
              "number",
              "null"
            ]
          },
          "avgLatencyMs": {
            "type": [
              "number",
              "null"
            ]
          },
          "p95LatencyMs": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "required": [
          "model",
          "providerModel",
          "provider",
          "credential",
          "state",
          "probeHealthy",
          "probeError",
          "requests",
          "errorRate",
          "avgLatencyMs",
          "p95LatencyMs"
        ],
        "additionalProperties": false
      }
    },
    "windowMinutes": {
      "type": "number"
    }
  },
  "required": [
    "models",
    "windowMinutes"
  ],
  "additionalProperties": false
}

GET /api/v1/batches

batches.list

کارهای دسته‌ای را از جدید به قدیم فهرست کنید، هر کدام با دفتر مصرف هر مدل و هزینهٔ معوق.

نقش
viewer
دامنه
usage:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "rows": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "batchId": {
            "type": "string"
          },
          "keyId": {
            "type": "string"
          },
          "endpoint": {
            "type": [
              "string",
              "null"
            ]
          },
          "inputFileId": {
            "type": [
              "string",
              "null"
            ]
          },
          "outputFileId": {
            "type": [
              "string",
              "null"
            ]
          },
          "errorFileId": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string"
          },
          "requestCounts": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              },
              {
                "type": "null"
              }
            ]
          },
          "submittedAt": {
            "type": "string"
          },
          "completedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "reconciledAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "reconcileAttempts": {
            "type": "number"
          },
          "lastError": {
            "type": [
              "string",
              "null"
            ]
          },
          "partial": {
            "type": "boolean"
          },
          "usage": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "batchId": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "logicalRequests": {
                  "type": "number"
                },
                "promptTokens": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "completionTokens": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "totalTokens": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "cachedTokens": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "costUsd": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "costSource": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "upstream",
                        "catalog",
                        "catalog_interactive"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "effectiveAt": {
                  "type": "string"
                }
              },
              "required": [
                "batchId",
                "model",
                "logicalRequests",
                "promptTokens",
                "completionTokens",
                "totalTokens",
                "cachedTokens",
                "costUsd",
                "costSource",
                "effectiveAt"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "batchId",
          "keyId",
          "endpoint",
          "inputFileId",
          "outputFileId",
          "errorFileId",
          "status",
          "requestCounts",
          "submittedAt",
          "completedAt",
          "reconciledAt",
          "reconcileAttempts",
          "lastError",
          "partial",
          "usage"
        ],
        "additionalProperties": false
      }
    },
    "caveat": {
      "type": "string"
    }
  },
  "required": [
    "rows",
    "caveat"
  ],
  "additionalProperties": false
}

GET /api/v1/observability/metrics

observability.metrics

روند روزانهٔ درخواست، توکن، هزینه و تأخیر را از Langfuse در یک بازه بخوانید (پیش‌فرض: ۱۴ روز).

نقش
viewer
دامنه
usage:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "configured": {
      "type": "boolean"
    },
    "from": {
      "type": [
        "string",
        "null"
      ]
    },
    "to": {
      "type": [
        "string",
        "null"
      ]
    },
    "points": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string"
          },
          "requests": {
            "type": "number"
          },
          "totalTokens": {
            "type": "number"
          },
          "costUsd": {
            "type": "number"
          },
          "avgLatencyMs": {
            "type": "number"
          }
        },
        "required": [
          "date",
          "requests",
          "totalTokens",
          "costUsd",
          "avgLatencyMs"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "configured",
    "from",
    "to",
    "points"
  ],
  "additionalProperties": false
}

GET /api/v1/logs

logs.list

ردیف‌های اخیر گزارش درخواست را از جدید به قدیم فهرست کنید: مسیر، کلید، مدل، وضعیت، تأخیر، توکن و هزینه. هرگز متن درخواست.

نقش
viewer
دامنه
logs:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "rows": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number"
          },
          "ts": {
            "type": "string"
          },
          "endpoint": {
            "type": "string"
          },
          "channel": {
            "type": "string",
            "enum": [
              "api",
              "subscription"
            ]
          },
          "route": {
            "type": [
              "string",
              "null"
            ]
          },
          "model": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "type": [
              "string",
              "null"
            ]
          },
          "keyId": {
            "type": "string"
          },
          "subjectType": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "human",
                  "workload"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "subjectId": {
            "type": [
              "string",
              "null"
            ]
          },
          "client": {
            "type": [
              "string",
              "null"
            ]
          },
          "sessionId": {
            "type": [
              "string",
              "null"
            ]
          },
          "endUser": {
            "type": [
              "string",
              "null"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "type": "string"
          },
          "streamed": {
            "type": "boolean"
          },
          "aborted": {
            "type": "boolean"
          },
          "latencyMs": {
            "type": "number"
          },
          "ttftMs": {
            "type": [
              "number",
              "null"
            ]
          },
          "promptTokens": {
            "type": [
              "number",
              "null"
            ]
          },
          "completionTokens": {
            "type": [
              "number",
              "null"
            ]
          },
          "totalTokens": {
            "type": [
              "number",
              "null"
            ]
          },
          "cachedTokens": {
            "type": [
              "number",
              "null"
            ]
          },
          "cacheWriteTokens": {
            "type": [
              "number",
              "null"
            ]
          },
          "imageCount": {
            "type": [
              "number",
              "null"
            ]
          },
          "audioSeconds": {
            "type": [
              "number",
              "null"
            ]
          },
          "characters": {
            "type": [
              "number",
              "null"
            ]
          },
          "documents": {
            "type": [
              "number",
              "null"
            ]
          },
          "costUsd": {
            "type": [
              "number",
              "null"
            ]
          },
          "costSource": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "upstream",
                  "catalog",
                  "catalog_interactive"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "guardFindings": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "logId": {
                      "type": "number"
                    },
                    "stage": {
                      "type": "string",
                      "enum": [
                        "request",
                        "response",
                        "tool_call",
                        "tool_result"
                      ]
                    },
                    "ruleId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "guard": {
                      "type": "string"
                    },
                    "ruleType": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "action": {
                      "type": "string"
                    },
                    "category": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "logId",
                    "stage",
                    "ruleId",
                    "guard",
                    "ruleType",
                    "action",
                    "category"
                  ],
                  "additionalProperties": false
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "packTokens": {
            "type": [
              "number",
              "null"
            ]
          },
          "packs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "number"
                },
                "logId": {
                  "type": "number"
                },
                "packId": {
                  "type": "string"
                },
                "versionId": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "assignmentId": {
                  "type": "string"
                },
                "outcome": {
                  "type": "string"
                },
                "tokens": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "chunkIndexes": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number"
                      }
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "logId",
                "packId",
                "versionId",
                "assignmentId",
                "outcome",
                "tokens"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "id",
          "ts",
          "endpoint",
          "channel",
          "keyId",
          "subjectType",
          "subjectId",
          "client",
          "sessionId",
          "tags",
          "status",
          "aborted",
          "latencyMs",
          "ttftMs",
          "cachedTokens",
          "cacheWriteTokens",
          "imageCount",
          "audioSeconds",
          "characters",
          "documents",
          "costUsd",
          "costSource",
          "guardFindings",
          "packTokens",
          "packs"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "rows"
  ],
  "additionalProperties": false
}

GET /api/v1/observability/traces

observability.traces.list

ردهای Langfuse را فهرست کنید (نام، زمان‌بندی، هزینه، برچسب) با فیلتر بازه، کاربر، برچسب یا نام. هرگز متن درخواست.

نقش
viewer
دامنه
logs:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "configured": {
      "type": "boolean"
    },
    "traces": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "user": {
            "type": [
              "string",
              "null"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "latencyMs": {
            "type": [
              "number",
              "null"
            ]
          },
          "costUsd": {
            "type": [
              "number",
              "null"
            ]
          },
          "observationCount": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "timestamp",
          "name",
          "user",
          "tags",
          "latencyMs",
          "costUsd",
          "observationCount"
        ],
        "additionalProperties": false
      }
    },
    "page": {
      "type": "number"
    },
    "totalPages": {
      "type": "number"
    },
    "totalItems": {
      "type": "number"
    }
  },
  "required": [
    "configured",
    "traces",
    "page",
    "totalPages",
    "totalItems"
  ],
  "additionalProperties": false
}

GET /api/v1/audit

audit.list

مدخل‌های گزارش ممیزی را از جدید به قدیم فهرست کنید: چه کسی چه چیزی را چه زمانی تغییر داد، با حالت پیش و پس.

نقش
owner
دامنه
audit:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "entries": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number"
          },
          "ts": {
            "type": "string"
          },
          "actorType": {
            "type": "string",
            "enum": [
              "user",
              "token"
            ]
          },
          "actorUserId": {
            "type": [
              "string",
              "null"
            ]
          },
          "actorEmail": {
            "type": [
              "string",
              "null"
            ]
          },
          "actorTokenId": {
            "type": [
              "string",
              "null"
            ]
          },
          "action": {
            "type": "string"
          },
          "resourceType": {
            "type": [
              "string",
              "null"
            ]
          },
          "resourceId": {
            "type": [
              "string",
              "null"
            ]
          },
          "before": {},
          "after": {},
          "ip": {
            "type": [
              "string",
              "null"
            ]
          },
          "userAgent": {
            "type": [
              "string",
              "null"
            ]
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "reasonCategory": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "ts",
          "actorType",
          "actorUserId",
          "actorEmail",
          "actorTokenId",
          "action",
          "resourceType",
          "resourceId",
          "before",
          "after",
          "ip",
          "userAgent",
          "reason",
          "reasonCategory"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "entries"
  ],
  "additionalProperties": false
}

GET /api/v1/keys

keys.list

کلیدهای کلاینت را با مالک، محدودیت مسیر و ZDR، دسترسی ابزار، تیم، بودجه و هزینه فهرست کنید. هرگز رمز.

نقش
viewer
دامنه
keys:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "keys": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "keyId": {
            "type": [
              "string",
              "null"
            ]
          },
          "label": {
            "type": "string"
          },
          "assignee": {
            "type": [
              "string",
              "null"
            ]
          },
          "ownerUserId": {
            "type": [
              "string",
              "null"
            ]
          },
          "ownerEmail": {
            "type": [
              "string",
              "null"
            ]
          },
          "allowedRoutes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "pinnedRoute": {
            "type": [
              "string",
              "null"
            ]
          },
          "requireZdr": {
            "type": "boolean"
          },
          "toolAccess": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "servers": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "tools": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "resources": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "prompts": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "groups": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "readOnly": {
                    "type": "boolean"
                  },
                  "version": {
                    "type": "number"
                  },
                  "syncedVersion": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "syncedAt": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "syncError": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "none",
                      "drift",
                      "ready"
                    ]
                  }
                },
                "required": [
                  "servers",
                  "tools",
                  "resources",
                  "prompts",
                  "groups",
                  "readOnly",
                  "version",
                  "syncedVersion",
                  "syncedAt",
                  "syncError",
                  "status"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "teamId": {
            "type": [
              "string",
              "null"
            ]
          },
          "budget": {
            "type": [
              "number",
              "null"
            ]
          },
          "budgetDuration": {
            "type": [
              "string",
              "null"
            ]
          },
          "spend": {
            "type": "number"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "revoked"
            ]
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "isCopilot": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "keyId",
          "label",
          "assignee",
          "ownerUserId",
          "ownerEmail",
          "allowedRoutes",
          "pinnedRoute",
          "budget",
          "budgetDuration",
          "spend",
          "status",
          "createdAt"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "keys"
  ],
  "additionalProperties": false
}

GET /api/v1/users

users.list

کاربران کنسول را با نقش، وضعیت، ارائه‌دهندهٔ هویت و آخرین ورود فهرست کنید.

نقش
owner
دامنه
users:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "users": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "member",
              "viewer",
              "admin",
              "owner"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "invited",
              "active",
              "disabled"
            ]
          },
          "authProvider": {
            "type": "string"
          },
          "externalId": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string"
          },
          "lastLoginAt": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "email",
          "name",
          "role",
          "status",
          "authProvider",
          "externalId",
          "createdAt",
          "lastLoginAt"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "users"
  ],
  "additionalProperties": false
}

GET /api/v1/users/directory

users.directory

حساب‌هایی را که می‌توانند مالک کلید باشند فهرست کنید: فقط شناسه، نام و ایمیل. حساب‌های غیرفعال حذف می‌شوند.

نقش
admin
دامنه
users:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "users": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "email"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "users"
  ],
  "additionalProperties": false
}

GET /api/v1/credentials

credentials.list

اعتبارنامه‌های ارائه‌دهنده را فهرست کنید: نام، ارائه‌دهنده و نشانی. هرگز کلید ارائه‌دهنده.

نقش
viewer
دامنه
providers:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "credentials": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "provider": {
            "type": [
              "string",
              "null"
            ]
          },
          "apiBase": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "name",
          "provider",
          "apiBase"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "credentials"
  ],
  "additionalProperties": false
}

GET /api/v1/credentials/usage

credentials.usage

مصرف هر اعتبارنامهٔ ارائه‌دهنده را در بازهٔ سقف آن بخوانید: توکن، دلار و درصد سقف.

نقش
viewer
دامنه
providers:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "usage": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "credential": {
            "type": "string"
          },
          "provider": {
            "type": [
              "string",
              "null"
            ]
          },
          "period": {
            "type": "string",
            "enum": [
              "month",
              "30d"
            ]
          },
          "windowStart": {
            "type": "string"
          },
          "models": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "usedTokens": {
            "type": "number"
          },
          "usedUsd": {
            "type": "number"
          },
          "unpricedModels": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "limitTokens": {
            "type": [
              "number",
              "null"
            ]
          },
          "limitUsd": {
            "type": [
              "number",
              "null"
            ]
          },
          "pctTokens": {
            "type": [
              "number",
              "null"
            ]
          },
          "pctUsd": {
            "type": [
              "number",
              "null"
            ]
          },
          "pct": {
            "type": [
              "number",
              "null"
            ]
          },
          "headroom": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "pctLeft": {
                    "type": "number"
                  },
                  "tokensRemaining": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "tokensLimit": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "requestsRemaining": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "requestsLimit": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "capturedAt": {
                    "type": "string"
                  }
                },
                "required": [
                  "model",
                  "pctLeft",
                  "tokensRemaining",
                  "tokensLimit",
                  "requestsRemaining",
                  "requestsLimit",
                  "capturedAt"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "credential",
          "provider",
          "period",
          "windowStart",
          "models",
          "usedTokens",
          "usedUsd",
          "unpricedModels",
          "limitTokens",
          "limitUsd",
          "pctTokens",
          "pctUsd",
          "pct",
          "headroom"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "usage"
  ],
  "additionalProperties": false
}

GET /api/v1/models/catalog

models.catalog

مدل‌های قابل مسیریابی را با مدل ارائه‌دهنده، اعتبارنامه و منبع آن‌ها فهرست کنید.

نقش
viewer
دامنه
config:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "models": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "providerModel": {
            "type": "string"
          },
          "credentialName": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "config",
              "database"
            ]
          }
        },
        "required": [
          "id",
          "name",
          "providerModel",
          "credentialName",
          "source"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "models"
  ],
  "additionalProperties": false
}

GET /api/v1/prices

prices.list

نرخ‌هایی را که درگاه هر درخواست را با آن‌ها قیمت‌گذاری می‌کند، برای هر مدل و با منبع هر نرخ فهرست کنید.

نقش
viewer
دامنه
providers:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "prices": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string"
          },
          "inputUsdPerMtok": {
            "type": [
              "number",
              "null"
            ]
          },
          "outputUsdPerMtok": {
            "type": [
              "number",
              "null"
            ]
          },
          "cacheReadUsdPerMtok": {
            "type": [
              "number",
              "null"
            ]
          },
          "cacheWriteUsdPerMtok": {
            "type": [
              "number",
              "null"
            ]
          },
          "imageUsdPerUnit": {
            "type": [
              "number",
              "null"
            ]
          },
          "audioUsdPerSecond": {
            "type": [
              "number",
              "null"
            ]
          },
          "characterUsdPerMchar": {
            "type": [
              "number",
              "null"
            ]
          },
          "maxInputTokens": {
            "type": [
              "number",
              "null"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "chassis",
              "manual"
            ]
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "required": [
          "model",
          "inputUsdPerMtok",
          "outputUsdPerMtok",
          "cacheReadUsdPerMtok",
          "cacheWriteUsdPerMtok",
          "imageUsdPerUnit",
          "audioUsdPerSecond",
          "characterUsdPerMchar",
          "maxInputTokens",
          "source",
          "updatedAt"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "prices"
  ],
  "additionalProperties": false
}

GET /api/v1/model-policy

model-policy.list

گواهی‌های نگه‌نداشتن داده (ZDR) هر مدل را فهرست کنید؛ کلیدها و مسیرهای فقط-ZDR بر اساس آن‌ها مسیریابی می‌شوند.

نقش
viewer
دامنه
providers:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "policies": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string"
          },
          "zdr": {
            "type": "boolean"
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "required": [
          "model",
          "zdr",
          "note",
          "updatedAt"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "policies"
  ],
  "additionalProperties": false
}

GET /api/v1/providers

providers.list

ارائه‌دهنده‌ها و مدل‌هایی را که رجیستری chassis می‌شناسد برای انتخاب مدل جدید فهرست کنید.

نقش
viewer
دامنه
providers:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "providers": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "models": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "model": {
                  "type": "string"
                },
                "providerModel": {
                  "type": "string"
                },
                "mode": {
                  "type": "string"
                }
              },
              "required": [
                "model",
                "providerModel",
                "mode"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "id",
          "models"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "providers"
  ],
  "additionalProperties": false
}

POST /api/v1/keys

keys.create

یک کلید کلاینت بسازید؛ رمز آن فقط یک بار برگردانده می‌شود. فقط در نشست انسانی.

نقش
admin
دامنه
keys:write
کلید یکتایی
required
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "label": {
      "type": "string",
      "minLength": 1
    },
    "ownerUserId": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "assignee": {
      "type": "string"
    },
    "budget": {
      "type": "number",
      "minimum": 0
    },
    "budgetDuration": {
      "type": "string",
      "minLength": 1
    },
    "allowedRoutes": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "pinnedRoute": {
      "type": "string",
      "minLength": 1
    }
  },
  "required": [
    "label"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "key": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "keyId": {
          "type": [
            "string",
            "null"
          ]
        },
        "label": {
          "type": "string"
        },
        "assignee": {
          "type": [
            "string",
            "null"
          ]
        },
        "ownerUserId": {
          "type": [
            "string",
            "null"
          ]
        },
        "ownerEmail": {
          "type": [
            "string",
            "null"
          ]
        },
        "allowedRoutes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "pinnedRoute": {
          "type": [
            "string",
            "null"
          ]
        },
        "requireZdr": {
          "type": "boolean"
        },
        "toolAccess": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "servers": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "tools": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "resources": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "prompts": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "groups": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "readOnly": {
                  "type": "boolean"
                },
                "version": {
                  "type": "number"
                },
                "syncedVersion": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "syncedAt": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "syncError": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "none",
                    "drift",
                    "ready"
                  ]
                }
              },
              "required": [
                "servers",
                "tools",
                "resources",
                "prompts",
                "groups",
                "readOnly",
                "version",
                "syncedVersion",
                "syncedAt",
                "syncError",
                "status"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "teamId": {
          "type": [
            "string",
            "null"
          ]
        },
        "budget": {
          "type": [
            "number",
            "null"
          ]
        },
        "budgetDuration": {
          "type": [
            "string",
            "null"
          ]
        },
        "spend": {
          "type": "number"
        },
        "status": {
          "type": "string",
          "enum": [
            "active",
            "revoked"
          ]
        },
        "createdAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "isCopilot": {
          "type": "boolean"
        },
        "secret": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "keyId",
        "label",
        "assignee",
        "ownerUserId",
        "ownerEmail",
        "allowedRoutes",
        "pinnedRoute",
        "budget",
        "budgetDuration",
        "spend",
        "status",
        "createdAt",
        "secret"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "key"
  ],
  "additionalProperties": false
}

DELETE /api/v1/keys/{id}

keys.revoke

یک کلید کلاینت را با شناسهٔ chassis آن باطل کنید؛ کلاینت‌ها بلافاصله متوقف می‌شوند. کلید copilot به force=true نیاز دارد.

نقش
admin
دامنه
keys:write
تکرار بی‌خطر
✓
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    }
  },
  "required": [
    "ok"
  ],
  "additionalProperties": false
}

POST /api/v1/keys/owner

keys.owner.set

مالک یک کلید را تعیین یا پاک کنید؛ هزینهٔ کلید زیر مصرف همین شخص گزارش می‌شود. فقط در نشست انسانی.

نقش
admin
دامنه
keys:write
تکرار بی‌خطر
✓
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "keyId": {
      "type": "string",
      "minLength": 1
    },
    "userId": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "keyId"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    },
    "ownerUserId": {
      "type": [
        "string",
        "null"
      ]
    },
    "ownerEmail": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "ok",
    "ownerUserId",
    "ownerEmail"
  ],
  "additionalProperties": false
}

POST /api/v1/keys/pin

keys.pin.set

یک کلید را به یک مسیر سنجاق کنید تا دسته‌بند نادیده گرفته شود، یا سنجاق را بردارید. فقط در نشست انسانی.

نقش
admin
دامنه
keys:write
تکرار بی‌خطر
✓
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "keyId": {
      "type": "string",
      "minLength": 1
    },
    "route": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "keyId",
    "route"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    },
    "pinned": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "ok",
    "pinned"
  ],
  "additionalProperties": false
}

POST /api/v1/keys/repair

keys.identity.repair

شناسهٔ ما را برای کلیدی که این کنسول نساخته ثبت کنید تا بتوان مالک، محدوده و سنجاق آن را تعیین کرد. فقط در نشست انسانی.

نقش
admin
دامنه
keys:write
تکرار بی‌خطر
✓
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "minLength": 1
    }
  },
  "required": [
    "id"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "keyId": {
      "type": "string"
    },
    "alreadyRecorded": {
      "type": "boolean"
    }
  },
  "required": [
    "keyId",
    "alreadyRecorded"
  ],
  "additionalProperties": false
}

POST /api/v1/keys/scope

keys.scope.set

مسیرهایی را که یک کلید می‌تواند به کار ببرد تعیین کنید؛ فهرست خالی یعنی همهٔ مسیرها. فقط در نشست انسانی.

نقش
admin
دامنه
keys:write
تکرار بی‌خطر
✓
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "keyId": {
      "type": "string",
      "minLength": 1
    },
    "routes": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "keyId",
    "routes"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    },
    "routes": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "ok",
    "routes"
  ],
  "additionalProperties": false
}

POST /api/v1/keys/zdr

keys.zdr.set

مدل‌های دارای گواهی ZDR را برای یک کلید الزامی کنید یا این الزام را بردارید. روشن کردن آن ممکن است ترافیک را بلافاصله رد کند. فقط در نشست انسانی.

نقش
admin
دامنه
keys:write
تکرار بی‌خطر
✓
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "keyId": {
      "type": "string",
      "minLength": 1
    },
    "required": {
      "type": "boolean"
    }
  },
  "required": [
    "keyId",
    "required"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    },
    "requireZdr": {
      "type": "boolean"
    }
  },
  "required": [
    "ok",
    "requireZdr"
  ],
  "additionalProperties": false
}

POST /api/v1/keys/tools

keys.tools.set

ابزارها، منابع و پرامپت‌های MCP مجاز یک کلید را تعیین کنید و نسخهٔ chassis را همگام کنید. فقط در نشست انسانی.

نقش
admin
دامنه
keys:write
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "keyId": {
      "type": "string",
      "minLength": 1
    },
    "servers": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tools": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "resources": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "prompts": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "groups": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "readOnly": {
      "type": "boolean"
    }
  },
  "required": [
    "keyId",
    "servers",
    "tools",
    "readOnly"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "access": {
      "type": "object",
      "properties": {
        "servers": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "tools": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "resources": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "prompts": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "groups": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "readOnly": {
          "type": "boolean"
        },
        "version": {
          "type": "number"
        },
        "syncedVersion": {
          "type": [
            "number",
            "null"
          ]
        },
        "syncedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "syncError": {
          "type": [
            "string",
            "null"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "none",
            "drift",
            "ready"
          ]
        }
      },
      "required": [
        "servers",
        "tools",
        "resources",
        "prompts",
        "groups",
        "readOnly",
        "version",
        "syncedVersion",
        "syncedAt",
        "syncError",
        "status"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "access"
  ],
  "additionalProperties": false
}

POST /api/v1/keys/tools/resync

keys.tools.resync

دسترسی ابزار ذخیره‌شدهٔ یک کلید را پس از همگام‌سازی ناموفق دوباره به chassis بفرستید. فقط در نشست انسانی.

نقش
admin
دامنه
keys:write
تکرار بی‌خطر
✓
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "keyId": {
      "type": "string",
      "minLength": 1
    }
  },
  "required": [
    "keyId"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "access": {
      "type": "object",
      "properties": {
        "servers": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "tools": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "resources": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "prompts": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "groups": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "readOnly": {
          "type": "boolean"
        },
        "version": {
          "type": "number"
        },
        "syncedVersion": {
          "type": [
            "number",
            "null"
          ]
        },
        "syncedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "syncError": {
          "type": [
            "string",
            "null"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "none",
            "drift",
            "ready"
          ]
        }
      },
      "required": [
        "servers",
        "tools",
        "resources",
        "prompts",
        "groups",
        "readOnly",
        "version",
        "syncedVersion",
        "syncedAt",
        "syncError",
        "status"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "access"
  ],
  "additionalProperties": false
}

DELETE /api/v1/keys/tools

keys.tools.revoke

دسترسی ابزار یک کلید را حذف کنید؛ پس از آن هیچ ابزاری را نمی‌تواند فراخوانی کند. فقط در نشست انسانی.

نقش
admin
دامنه
keys:write
تکرار بی‌خطر
✓
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    }
  },
  "required": [
    "ok"
  ],
  "additionalProperties": false
}

POST /api/v1/keys/team

keys.team.set

یک کلید را در تیمی بگذارید که دسترسی ابزارش با دسترسی کلید AND می‌شود، یا آن را از تیم بیرون بیاورید. فقط در نشست انسانی.

نقش
admin
دامنه
keys:write
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "keyId": {
      "type": "string",
      "minLength": 1
    },
    "teamId": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 1
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "keyId",
    "teamId"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "teamId": {
      "type": [
        "string",
        "null"
      ]
    },
    "access": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "servers": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "tools": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "resources": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "prompts": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "groups": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "readOnly": {
              "type": "boolean"
            },
            "version": {
              "type": "number"
            },
            "syncedVersion": {
              "type": [
                "number",
                "null"
              ]
            },
            "syncedAt": {
              "type": [
                "string",
                "null"
              ]
            },
            "syncError": {
              "type": [
                "string",
                "null"
              ]
            },
            "status": {
              "type": "string",
              "enum": [
                "none",
                "drift",
                "ready"
              ]
            }
          },
          "required": [
            "servers",
            "tools",
            "resources",
            "prompts",
            "groups",
            "readOnly",
            "version",
            "syncedVersion",
            "syncedAt",
            "syncError",
            "status"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "teamId",
    "access"
  ],
  "additionalProperties": false
}

POST /api/v1/users

users.create

یک کاربر کنسول را با ایمیل و نقش از پیش تعریف کنید. ایمیل تکراری خطای 409 می‌دهد. فقط در نشست انسانی.

نقش
owner
دامنه
users:write
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "pattern": "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$"
    },
    "role": {
      "type": "string",
      "enum": [
        "owner",
        "admin",
        "viewer"
      ]
    },
    "name": {
      "type": "string"
    }
  },
  "required": [
    "email",
    "role"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "user": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "role": {
          "type": "string",
          "enum": [
            "member",
            "viewer",
            "admin",
            "owner"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "invited",
            "active",
            "disabled"
          ]
        },
        "authProvider": {
          "type": "string"
        },
        "externalId": {
          "type": [
            "string",
            "null"
          ]
        },
        "createdAt": {
          "type": "string"
        },
        "lastLoginAt": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "email",
        "name",
        "role",
        "status",
        "authProvider",
        "externalId",
        "createdAt",
        "lastLoginAt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "user"
  ],
  "additionalProperties": false
}

PATCH /api/v1/users/{id}

users.update

نقش یا وضعیت یک کاربر را تغییر دهید. هیچ‌کس نقش خودش را تغییر نمی‌دهد و آخرین مالک فعال می‌ماند. فقط در نشست انسانی.

نقش
owner
دامنه
users:write
تکرار بی‌خطر
✓
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "role": {
      "type": "string",
      "enum": [
        "owner",
        "admin",
        "viewer"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "invited",
        "active",
        "disabled"
      ]
    }
  }
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    },
    "role": {
      "type": "string",
      "enum": [
        "member",
        "viewer",
        "admin",
        "owner"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "invited",
        "active",
        "disabled"
      ]
    }
  },
  "required": [
    "ok",
    "role",
    "status"
  ],
  "additionalProperties": false
}

POST /api/v1/credentials

credentials.create

یک کلید ارائه‌دهنده را با نامی که مدل‌ها به آن ارجاع می‌دهند در chassis ذخیره کنید. فقط در نشست انسانی.

نقش
owner
دامنه
providers:write
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1
    },
    "provider": {
      "type": "string",
      "minLength": 1
    },
    "apiKey": {
      "type": "string",
      "minLength": 1
    },
    "apiBase": {
      "type": "string"
    }
  },
  "required": [
    "name",
    "provider",
    "apiKey"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    }
  },
  "required": [
    "ok"
  ],
  "additionalProperties": false
}

PATCH /api/v1/credentials/{name}

credentials.rotate

یک کلید ارائه‌دهنده را در جای خود عوض کنید؛ مدل‌ها از درخواست بعدی کلید تازه را به کار می‌برند. فقط در نشست انسانی.

نقش
owner
دامنه
providers:write
تکرار بی‌خطر
✓
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "apiKey": {
      "type": "string",
      "minLength": 1
    }
  },
  "required": [
    "apiKey"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    }
  },
  "required": [
    "ok"
  ],
  "additionalProperties": false
}

DELETE /api/v1/credentials/{name}

credentials.delete

یک اعتبارنامهٔ ارائه‌دهنده و سقف اعلام‌شدهٔ آن را حذف کنید. خطای 409 مدل‌هایی را که هنوز از آن استفاده می‌کنند نام می‌برد. فقط در نشست انسانی.

نقش
owner
دامنه
providers:write
تکرار بی‌خطر
✓
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    }
  },
  "required": [
    "ok"
  ],
  "additionalProperties": false
}

PUT /api/v1/credentials/{name}/limit

credentials.limit.set

سقف توکن و دلار یک اعتبارنامه را برای هر بازه اعلام کنید؛ هر دو null یعنی پاک کردن سقف. فقط در نشست انسانی.

نقش
owner
دامنه
providers:write
تکرار بی‌خطر
✓
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "limitTokens": {
      "anyOf": [
        {
          "type": "number",
          "exclusiveMinimum": 0
        },
        {
          "type": "null"
        }
      ]
    },
    "limitUsd": {
      "anyOf": [
        {
          "type": "number",
          "exclusiveMinimum": 0
        },
        {
          "type": "null"
        }
      ]
    },
    "period": {
      "type": "string",
      "enum": [
        "month",
        "30d"
      ]
    }
  }
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "limit": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "credentialName": {
              "type": "string"
            },
            "limitTokens": {
              "type": [
                "number",
                "null"
              ]
            },
            "limitUsd": {
              "type": [
                "number",
                "null"
              ]
            },
            "period": {
              "type": "string",
              "enum": [
                "month",
                "30d"
              ]
            },
            "updatedAt": {
              "type": "string"
            }
          },
          "required": [
            "credentialName",
            "limitTokens",
            "limitUsd",
            "period",
            "updatedAt"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "limit"
  ],
  "additionalProperties": false
}

POST /api/v1/models

models.create

یک مدل به کاتالوگ chassis اضافه کنید. مدل باید یک اعتبارنامهٔ موجود را نام ببرد. فقط در نشست انسانی.

نقش
admin
دامنه
config:write
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1
    },
    "providerModel": {
      "type": "string",
      "minLength": 1
    },
    "credentialName": {
      "default": "",
      "type": "string"
    },
    "apiBase": {
      "type": "string"
    }
  },
  "required": [
    "name",
    "providerModel"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    }
  },
  "required": [
    "ok"
  ],
  "additionalProperties": false
}

PUT /api/v1/models/{id}

models.update

مدل ارائه‌دهنده، اعتبارنامه یا نشانی یک مدل افزوده‌شده در کنسول را به‌روز کنید. مدل‌های اولیه در git مدیریت می‌شوند. فقط در نشست انسانی.

نقش
admin
دامنه
config:write
تکرار بی‌خطر
✓
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1
    },
    "providerModel": {
      "type": "string",
      "minLength": 1
    },
    "credentialName": {
      "default": "",
      "type": "string"
    },
    "apiBase": {
      "type": "string"
    }
  },
  "required": [
    "name",
    "providerModel"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    }
  },
  "required": [
    "ok"
  ],
  "additionalProperties": false
}

DELETE /api/v1/models/{id}

models.delete

یک مدل افزوده‌شده در کنسول را از کاتالوگ chassis حذف کنید. فقط در نشست انسانی.

نقش
admin
دامنه
config:write
تکرار بی‌خطر
✓
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    }
  },
  "required": [
    "ok"
  ],
  "additionalProperties": false
}

POST /api/v1/prices

prices.import

قیمت‌های فهرست کاتالوگ chassis را وارد کنید. نرخ‌های دستی هرگز بازنویسی نمی‌شوند. فقط در نشست انسانی.

نقش
admin
دامنه
providers:write
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "found": {
      "type": "number"
    },
    "imported": {
      "type": "number"
    },
    "skippedManual": {
      "type": "number"
    }
  },
  "required": [
    "found",
    "imported",
    "skippedManual"
  ],
  "additionalProperties": false
}

PUT /api/v1/prices

prices.set

نرخ‌های یک مدل را دستی تعیین کنید (قیمت توافقی). نرخ غایب یعنی نامعلوم. فقط در نشست انسانی.

نقش
admin
دامنه
providers:write
تکرار بی‌خطر
✓
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "model": {
      "type": "string",
      "minLength": 1
    },
    "inputUsdPerMtok": {
      "anyOf": [
        {
          "type": "number",
          "minimum": 0
        },
        {
          "type": "null"
        }
      ]
    },
    "outputUsdPerMtok": {
      "anyOf": [
        {
          "type": "number",
          "minimum": 0
        },
        {
          "type": "null"
        }
      ]
    },
    "cacheReadUsdPerMtok": {
      "anyOf": [
        {
          "type": "number",
          "minimum": 0
        },
        {
          "type": "null"
        }
      ]
    },
    "cacheWriteUsdPerMtok": {
      "anyOf": [
        {
          "type": "number",
          "minimum": 0
        },
        {
          "type": "null"
        }
      ]
    },
    "imageUsdPerUnit": {
      "anyOf": [
        {
          "type": "number",
          "minimum": 0
        },
        {
          "type": "null"
        }
      ]
    },
    "audioUsdPerSecond": {
      "anyOf": [
        {
          "type": "number",
          "minimum": 0
        },
        {
          "type": "null"
        }
      ]
    },
    "characterUsdPerMchar": {
      "anyOf": [
        {
          "type": "number",
          "minimum": 0
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "model"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "price": {
      "type": "object",
      "properties": {
        "model": {
          "type": "string"
        },
        "inputUsdPerMtok": {
          "type": [
            "number",
            "null"
          ]
        },
        "outputUsdPerMtok": {
          "type": [
            "number",
            "null"
          ]
        },
        "cacheReadUsdPerMtok": {
          "type": [
            "number",
            "null"
          ]
        },
        "cacheWriteUsdPerMtok": {
          "type": [
            "number",
            "null"
          ]
        },
        "imageUsdPerUnit": {
          "type": [
            "number",
            "null"
          ]
        },
        "audioUsdPerSecond": {
          "type": [
            "number",
            "null"
          ]
        },
        "characterUsdPerMchar": {
          "type": [
            "number",
            "null"
          ]
        },
        "maxInputTokens": {
          "type": [
            "number",
            "null"
          ]
        },
        "source": {
          "type": "string",
          "enum": [
            "chassis",
            "manual"
          ]
        },
        "updatedAt": {
          "type": "string"
        }
      },
      "required": [
        "model",
        "inputUsdPerMtok",
        "outputUsdPerMtok",
        "cacheReadUsdPerMtok",
        "cacheWriteUsdPerMtok",
        "imageUsdPerUnit",
        "audioUsdPerSecond",
        "characterUsdPerMchar",
        "maxInputTokens",
        "source",
        "updatedAt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "price"
  ],
  "additionalProperties": false
}

DELETE /api/v1/prices

prices.delete

نرخ‌های یک مدل را حذف کنید؛ درخواست‌های آن بدون قیمت می‌مانند. فقط در نشست انسانی.

نقش
admin
دامنه
providers:write
تکرار بی‌خطر
✓
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    }
  },
  "required": [
    "ok"
  ],
  "additionalProperties": false
}

PUT /api/v1/model-policy

model-policy.set

گواهی ZDR یک مدل را ثبت یا پس بگیرید — ادعایی که یک اپراتور با یادداشت آن ثبت می‌کند. فقط در نشست انسانی.

نقش
admin
دامنه
providers:write
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "model": {
      "type": "string",
      "minLength": 1
    },
    "zdr": {
      "type": "boolean"
    },
    "note": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "model",
    "zdr"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "policy": {
      "type": "object",
      "properties": {
        "model": {
          "type": "string"
        },
        "zdr": {
          "type": "boolean"
        },
        "note": {
          "type": [
            "string",
            "null"
          ]
        },
        "updatedAt": {
          "type": "string"
        }
      },
      "required": [
        "model",
        "zdr",
        "note",
        "updatedAt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "policy"
  ],
  "additionalProperties": false
}

DELETE /api/v1/model-policy

model-policy.delete

گواهی یک مدل را حذف کنید تا بدون گواهی شود. ترافیک فقط-ZDR دیگر از آن استفاده نمی‌کند. فقط در نشست انسانی.

نقش
admin
دامنه
providers:write
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    }
  },
  "required": [
    "ok"
  ],
  "additionalProperties": false
}

GET /api/v1/tools/servers

tools.servers.list

سرورهای MCP و REST ثبت‌شده را با همهٔ ابزارها، منابع و پرامپت‌هایی که اعلام می‌کنند فهرست کنید. هرگز اعتبارنامه.

نقش
viewer
دامنه
tools:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "servers": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "serverId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "transport": {
            "type": "string",
            "enum": [
              "http",
              "sse"
            ]
          },
          "authType": {
            "type": "string",
            "enum": [
              "none",
              "api_key",
              "bearer_token",
              "oauth2"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "tools": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "readOnly": {
                  "type": "boolean"
                },
                "destructive": {
                  "type": "boolean"
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "requiredScopes": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "mask": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "rateLimit": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "requests": {
                          "type": "number"
                        },
                        "windowSeconds": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "requests",
                        "windowSeconds"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "requiresApproval": {
                  "type": "boolean"
                },
                "allowedParams": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "rest": {
                  "type": "object",
                  "properties": {
                    "method": {
                      "type": "string",
                      "enum": [
                        "GET",
                        "POST",
                        "PUT",
                        "PATCH",
                        "DELETE"
                      ]
                    },
                    "path": {
                      "type": "string"
                    },
                    "parameters": {
                      "$ref": "#/$defs/__schema0"
                    }
                  },
                  "required": [
                    "method",
                    "path",
                    "parameters"
                  ],
                  "additionalProperties": false
                },
                "policyInvalid": {
                  "type": "boolean"
                }
              },
              "required": [
                "name",
                "readOnly",
                "destructive",
                "description"
              ],
              "additionalProperties": false
            }
          },
          "resources": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "uri": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "mimeType": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "requiredScopes": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "policyInvalid": {
                  "type": "boolean"
                }
              },
              "required": [
                "uri",
                "name",
                "description",
                "mimeType"
              ],
              "additionalProperties": false
            }
          },
          "prompts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "requiredScopes": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "policyInvalid": {
                  "type": "boolean"
                }
              },
              "required": [
                "name",
                "description"
              ],
              "additionalProperties": false
            }
          },
          "custody": {
            "type": "string",
            "enum": [
              "service",
              "connection"
            ]
          },
          "provider": {
            "type": [
              "string",
              "null"
            ]
          },
          "audience": {
            "type": [
              "string",
              "null"
            ]
          },
          "maxScopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "variables": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "header": {
                  "type": "string"
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "required": {
                  "type": "boolean"
                }
              },
              "required": [
                "name",
                "header",
                "description",
                "required"
              ],
              "additionalProperties": false
            }
          },
          "kind": {
            "type": "string",
            "enum": [
              "mcp",
              "rest"
            ]
          },
          "restAuth": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "location": {
                    "type": "string",
                    "enum": [
                      "header",
                      "query"
                    ]
                  },
                  "name": {
                    "type": "string"
                  },
                  "prefix": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "location",
                  "name",
                  "prefix"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "serverId",
          "name",
          "url",
          "transport",
          "authType",
          "enabled",
          "description",
          "tools",
          "resources",
          "prompts"
        ],
        "additionalProperties": false
      }
    },
    "tools": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "canonicalName": {
            "type": "string"
          },
          "server": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "readOnly": {
            "type": "boolean"
          },
          "destructive": {
            "type": "boolean"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "canonicalName",
          "server",
          "name",
          "readOnly",
          "destructive",
          "description",
          "enabled"
        ],
        "additionalProperties": false
      }
    },
    "resources": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "uri": {
            "type": "string"
          },
          "template": {
            "type": "boolean"
          },
          "server": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "mimeType": {
            "type": [
              "string",
              "null"
            ]
          },
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "uri",
          "template",
          "server",
          "name",
          "description",
          "mimeType",
          "enabled"
        ],
        "additionalProperties": false
      }
    },
    "prompts": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "canonicalName": {
            "type": "string"
          },
          "server": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "canonicalName",
          "server",
          "name",
          "description",
          "enabled"
        ],
        "additionalProperties": false
      }
    },
    "restCredentials": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "serverId": {
            "type": "string"
          },
          "generation": {
            "type": "number"
          },
          "updatedAt": {
            "type": "string"
          },
          "updatedByUserId": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "serverId",
          "generation",
          "updatedAt",
          "updatedByUserId"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "servers",
    "tools",
    "resources",
    "prompts",
    "restCredentials"
  ],
  "additionalProperties": false,
  "$defs": {
    "__schema0": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "object",
            "array",
            "string",
            "number",
            "integer",
            "boolean",
            "null"
          ]
        },
        "description": {
          "type": "string"
        },
        "properties": {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "$ref": "#/$defs/__schema0"
          }
        },
        "required": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "visible": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "items": {
          "$ref": "#/$defs/__schema0"
        },
        "enum": {
          "type": "array",
          "items": {}
        },
        "default": {}
      },
      "additionalProperties": {}
    }
  }
}

GET /api/v1/tools/servers/{id}/inspect

tools.servers.inspect

یک سرور ثبت‌شده را فقط از داده‌های ذخیره‌شده بررسی کنید: مجوزهایی که به آن می‌رسند، فعالیت اخیر دفتر ثبت و تداخل نام‌ها.

نقش
viewer
دامنه
tools:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "server": {
      "type": "object",
      "properties": {
        "serverId": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "url": {
          "type": "string"
        },
        "transport": {
          "type": "string",
          "enum": [
            "http",
            "sse"
          ]
        },
        "authType": {
          "type": "string",
          "enum": [
            "none",
            "api_key",
            "bearer_token",
            "oauth2"
          ]
        },
        "enabled": {
          "type": "boolean"
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "tools": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "readOnly": {
                "type": "boolean"
              },
              "destructive": {
                "type": "boolean"
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "requiredScopes": {
                "anyOf": [
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "mask": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "rateLimit": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "requests": {
                        "type": "number"
                      },
                      "windowSeconds": {
                        "type": "number"
                      }
                    },
                    "required": [
                      "requests",
                      "windowSeconds"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "requiresApproval": {
                "type": "boolean"
              },
              "allowedParams": {
                "anyOf": [
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "rest": {
                "type": "object",
                "properties": {
                  "method": {
                    "type": "string",
                    "enum": [
                      "GET",
                      "POST",
                      "PUT",
                      "PATCH",
                      "DELETE"
                    ]
                  },
                  "path": {
                    "type": "string"
                  },
                  "parameters": {
                    "$ref": "#/$defs/__schema0"
                  }
                },
                "required": [
                  "method",
                  "path",
                  "parameters"
                ],
                "additionalProperties": false
              },
              "policyInvalid": {
                "type": "boolean"
              }
            },
            "required": [
              "name",
              "readOnly",
              "destructive",
              "description"
            ],
            "additionalProperties": false
          }
        },
        "resources": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "uri": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "mimeType": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "requiredScopes": {
                "anyOf": [
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "policyInvalid": {
                "type": "boolean"
              }
            },
            "required": [
              "uri",
              "name",
              "description",
              "mimeType"
            ],
            "additionalProperties": false
          }
        },
        "prompts": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "requiredScopes": {
                "anyOf": [
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "policyInvalid": {
                "type": "boolean"
              }
            },
            "required": [
              "name",
              "description"
            ],
            "additionalProperties": false
          }
        },
        "custody": {
          "type": "string",
          "enum": [
            "service",
            "connection"
          ]
        },
        "provider": {
          "type": [
            "string",
            "null"
          ]
        },
        "audience": {
          "type": [
            "string",
            "null"
          ]
        },
        "maxScopes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "variables": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "header": {
                "type": "string"
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "required": {
                "type": "boolean"
              }
            },
            "required": [
              "name",
              "header",
              "description",
              "required"
            ],
            "additionalProperties": false
          }
        },
        "kind": {
          "type": "string",
          "enum": [
            "mcp",
            "rest"
          ]
        },
        "restAuth": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "location": {
                  "type": "string",
                  "enum": [
                    "header",
                    "query"
                  ]
                },
                "name": {
                  "type": "string"
                },
                "prefix": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "location",
                "name",
                "prefix"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "serverId",
        "name",
        "url",
        "transport",
        "authType",
        "enabled",
        "description",
        "tools",
        "resources",
        "prompts"
      ],
      "additionalProperties": false
    },
    "reach": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "key",
              "team"
            ]
          },
          "principalId": {
            "type": "string"
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          },
          "tools": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "readOnly": {
            "type": "boolean"
          },
          "synced": {
            "type": "boolean"
          },
          "syncError": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "kind",
          "principalId",
          "label",
          "tools",
          "readOnly",
          "synced",
          "syncError"
        ],
        "additionalProperties": false
      }
    },
    "activity": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "group": {
            "type": "string"
          },
          "calls": {
            "type": "number"
          },
          "dispatched": {
            "type": "number"
          },
          "denied": {
            "type": "number"
          },
          "pending": {
            "type": "number"
          },
          "failed": {
            "type": "number"
          },
          "unknown": {
            "type": "number"
          },
          "costUsd": {
            "type": "number"
          },
          "unpricedCalls": {
            "type": "number"
          },
          "avgLatencyMs": {
            "type": [
              "number",
              "null"
            ]
          },
          "p95LatencyMs": {
            "type": [
              "number",
              "null"
            ]
          },
          "subjectName": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "group",
          "calls",
          "dispatched",
          "denied",
          "pending",
          "failed",
          "unknown",
          "costUsd",
          "unpricedCalls",
          "avgLatencyMs",
          "p95LatencyMs",
          "subjectName"
        ],
        "additionalProperties": false
      }
    },
    "activityDays": {
      "type": "number"
    },
    "ambiguous": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "server",
    "reach",
    "activity",
    "activityDays",
    "ambiguous"
  ],
  "additionalProperties": false,
  "$defs": {
    "__schema0": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "object",
            "array",
            "string",
            "number",
            "integer",
            "boolean",
            "null"
          ]
        },
        "description": {
          "type": "string"
        },
        "properties": {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "$ref": "#/$defs/__schema0"
          }
        },
        "required": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "visible": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "items": {
          "$ref": "#/$defs/__schema0"
        },
        "enum": {
          "type": "array",
          "items": {}
        },
        "default": {}
      },
      "additionalProperties": {}
    }
  }
}

GET /api/v1/teams

teams.list

تیم‌هایی را که یک کلید می‌تواند عضو آن‌ها شود، با مجوز ابزار و تعداد اعضای هر تیم فهرست کنید.

نقش
viewer
دامنه
tools:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "teams": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "teamId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "members": {
            "type": "number"
          },
          "toolAccess": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "servers": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "tools": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "resources": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "prompts": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "groups": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "readOnly": {
                    "type": "boolean"
                  },
                  "version": {
                    "type": "number"
                  },
                  "syncedVersion": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "syncedAt": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "syncError": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "none",
                      "drift",
                      "ready"
                    ]
                  }
                },
                "required": [
                  "servers",
                  "tools",
                  "resources",
                  "prompts",
                  "groups",
                  "readOnly",
                  "version",
                  "syncedVersion",
                  "syncedAt",
                  "syncError",
                  "status"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "teamId",
          "name",
          "description",
          "createdAt",
          "updatedAt",
          "members",
          "toolAccess"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "teams"
  ],
  "additionalProperties": false
}

GET /api/v1/tools/groups

tools.groups.list

گروه‌های ابزار را فهرست کنید: بسته‌های نام‌دار از سرورها، ابزارها، منابع و پرامپت‌ها که یک مجوز می‌تواند نام ببرد.

نقش
viewer
دامنه
tools:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "groups": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "groupId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "servers": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "tools": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "resources": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "prompts": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "required": [
          "groupId",
          "name",
          "description",
          "servers",
          "tools",
          "resources",
          "prompts",
          "updatedAt"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "groups"
  ],
  "additionalProperties": false
}

GET /api/v1/tools/virtual-servers

tools.virtual-servers.list

سرورهای مجازی را فهرست کنید: مجموعه‌ابزارهای نام‌داری که یک عامل به‌صورت یک نقطهٔ پایانی سوار می‌کند. یک سرور مجازی فقط مجوز را محدود می‌کند.

نقش
viewer
دامنه
tools:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "virtualServers": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "serverId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "servers": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "tools": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "resources": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "prompts": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "groups": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "disclosure": {
            "type": "string",
            "enum": [
              "all",
              "progressive"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "required": [
          "serverId",
          "name",
          "description",
          "servers",
          "tools",
          "resources",
          "prompts",
          "groups",
          "disclosure",
          "enabled",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      }
    },
    "gatewayUrl": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "virtualServers",
    "gatewayUrl"
  ],
  "additionalProperties": false
}

GET /api/v1/tools/variables

tools.variables.read

متغیرهای سرور یک کلید حساب سرویس (سایت، شناسهٔ فضای کار) را برای هر سروری که آن‌ها را اعلام می‌کند بخوانید. هرگز رمز.

نقش
admin
دامنه
tools:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "servers": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "serverId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "variables": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "required": {
                  "type": "boolean"
                },
                "value": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "name",
                "description",
                "required",
                "value"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "serverId",
          "name",
          "variables"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "servers"
  ],
  "additionalProperties": false
}

GET /api/v1/tools/calls

tools.calls.list

ردیف‌های دفتر ثبت فراخوانی ابزار را از جدید به قدیم فهرست کنید: شخص، ابزار، تصمیم، نتیجه، تأخیر و هزینه، همراه با فراخوانی‌های ردشده. هرگز آرگومان یا نتیجه.

نقش
viewer
دامنه
logs:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "rows": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number"
          },
          "ts": {
            "type": "string"
          },
          "requestLogId": {
            "type": [
              "number",
              "null"
            ]
          },
          "keyId": {
            "type": "string"
          },
          "subjectType": {
            "type": "string",
            "enum": [
              "human",
              "workload"
            ]
          },
          "subjectId": {
            "type": "string"
          },
          "connectionId": {
            "type": [
              "string",
              "null"
            ]
          },
          "server": {
            "type": "string"
          },
          "primitive": {
            "type": "string",
            "enum": [
              "tool",
              "resource",
              "prompt"
            ]
          },
          "tool": {
            "type": "string"
          },
          "policyVersion": {
            "type": "number"
          },
          "decision": {
            "type": "string",
            "enum": [
              "allowed",
              "denied",
              "approval_pending",
              "approved",
              "rejected"
            ]
          },
          "dispatchedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "finishedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "outcome": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "ok",
                  "failed",
                  "unknown"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "latencyMs": {
            "type": [
              "number",
              "null"
            ]
          },
          "costUsd": {
            "type": [
              "number",
              "null"
            ]
          },
          "costSource": {
            "type": "string",
            "enum": [
              "chassis",
              "declared",
              "none"
            ]
          },
          "guardFindings": {
            "type": "number"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "mount": {
            "type": [
              "string",
              "null"
            ]
          },
          "skillVersionId": {
            "type": [
              "string",
              "null"
            ]
          },
          "sessionId": {
            "type": [
              "string",
              "null"
            ]
          },
          "subjectName": {
            "type": [
              "string",
              "null"
            ]
          },
          "subjectEmail": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "ts",
          "requestLogId",
          "keyId",
          "subjectType",
          "subjectId",
          "connectionId",
          "server",
          "primitive",
          "tool",
          "policyVersion",
          "decision",
          "dispatchedAt",
          "finishedAt",
          "outcome",
          "latencyMs",
          "costUsd",
          "costSource",
          "guardFindings",
          "reason",
          "mount",
          "skillVersionId",
          "sessionId",
          "subjectName",
          "subjectEmail"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "rows"
  ],
  "additionalProperties": false
}

GET /api/v1/connections

connections.list

همهٔ اتصال‌های بالادستی را فهرست کنید: مالک، ارائه‌دهنده، دامنه‌های دسترسی، وضعیت و آخرین استفاده. هرگز توکن.

نقش
viewer
دامنه
connections:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "connections": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "connectionId": {
            "type": "string"
          },
          "subjectType": {
            "type": "string",
            "enum": [
              "human",
              "workload"
            ]
          },
          "subjectId": {
            "type": "string"
          },
          "subjectLabel": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "providerName": {
            "type": "string"
          },
          "audience": {
            "type": "string"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "state": {
            "type": "string",
            "enum": [
              "active",
              "reauth_required",
              "revoked"
            ]
          },
          "stateReason": {
            "type": [
              "string",
              "null"
            ]
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string"
          },
          "lastUsedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "revokedAt": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "connectionId",
          "subjectType",
          "subjectId",
          "subjectLabel",
          "provider",
          "providerName",
          "audience",
          "scopes",
          "state",
          "stateReason",
          "expiresAt",
          "createdAt",
          "lastUsedAt",
          "revokedAt"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "connections"
  ],
  "additionalProperties": false
}

GET /api/v1/connections/providers

connections.providers.list

ارائه‌دهنده‌های OAuth را که یک شخص می‌تواند حساب خود را به آن‌ها وصل کند، با نشانی‌هایشان فهرست کنید. هرگز رمز کلاینت.

نقش
viewer
دامنه
connections:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "providers": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "provider": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "authorizationUrl": {
            "type": "string"
          },
          "tokenUrl": {
            "type": "string"
          },
          "revocationUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "clientId": {
            "type": "string"
          },
          "hasSecret": {
            "type": "boolean"
          },
          "audience": {
            "type": "string"
          },
          "defaultScopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "enabled": {
            "type": "boolean"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "required": [
          "provider",
          "displayName",
          "authorizationUrl",
          "tokenUrl",
          "revocationUrl",
          "clientId",
          "hasSecret",
          "audience",
          "defaultScopes",
          "enabled",
          "updatedAt"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "providers"
  ],
  "additionalProperties": false
}

POST /api/v1/tools/servers

tools.servers.register

یک سرور MCP یا REST ثبت کنید تا یک سامانهٔ بیرونی از راه این درگاه در دسترس باشد. شناسهٔ تکراری خطای ۴۰۹ می‌دهد. فقط در نشست انسانی.

نقش
admin
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "serverId": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "enum": [
        "mcp",
        "rest"
      ]
    },
    "name": {
      "type": "string"
    },
    "url": {
      "type": "string"
    },
    "transport": {
      "type": "string",
      "enum": [
        "http",
        "sse"
      ]
    },
    "authType": {
      "type": "string",
      "enum": [
        "none",
        "api_key",
        "bearer_token",
        "oauth2"
      ]
    },
    "enabled": {
      "type": "boolean"
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "tools": {
      "type": "array",
      "items": {
        "type": "object",
        "propertyNames": {
          "type": "string"
        },
        "additionalProperties": {}
      }
    },
    "resources": {
      "type": "array",
      "items": {
        "type": "object",
        "propertyNames": {
          "type": "string"
        },
        "additionalProperties": {}
      }
    },
    "prompts": {
      "type": "array",
      "items": {
        "type": "object",
        "propertyNames": {
          "type": "string"
        },
        "additionalProperties": {}
      }
    },
    "variables": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "custody": {
      "type": "string",
      "enum": [
        "service",
        "connection"
      ]
    },
    "provider": {
      "type": [
        "string",
        "null"
      ]
    },
    "audience": {
      "type": [
        "string",
        "null"
      ]
    },
    "maxScopes": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "restAuth": {
      "anyOf": [
        {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {}
        },
        {
          "type": "null"
        }
      ]
    },
    "credential": {
      "type": [
        "string",
        "null"
      ]
    },
    "clearCredential": {
      "type": "boolean"
    }
  },
  "required": [
    "serverId",
    "name",
    "url",
    "transport",
    "authType"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "server": {
      "type": "object",
      "properties": {
        "serverId": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "url": {
          "type": "string"
        },
        "transport": {
          "type": "string",
          "enum": [
            "http",
            "sse"
          ]
        },
        "authType": {
          "type": "string",
          "enum": [
            "none",
            "api_key",
            "bearer_token",
            "oauth2"
          ]
        },
        "enabled": {
          "type": "boolean"
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "tools": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "readOnly": {
                "type": "boolean"
              },
              "destructive": {
                "type": "boolean"
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "requiredScopes": {
                "anyOf": [
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "mask": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "rateLimit": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "requests": {
                        "type": "number"
                      },
                      "windowSeconds": {
                        "type": "number"
                      }
                    },
                    "required": [
                      "requests",
                      "windowSeconds"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "requiresApproval": {
                "type": "boolean"
              },
              "allowedParams": {
                "anyOf": [
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "rest": {
                "type": "object",
                "properties": {
                  "method": {
                    "type": "string",
                    "enum": [
                      "GET",
                      "POST",
                      "PUT",
                      "PATCH",
                      "DELETE"
                    ]
                  },
                  "path": {
                    "type": "string"
                  },
                  "parameters": {
                    "$ref": "#/$defs/__schema0"
                  }
                },
                "required": [
                  "method",
                  "path",
                  "parameters"
                ],
                "additionalProperties": false
              },
              "policyInvalid": {
                "type": "boolean"
              }
            },
            "required": [
              "name",
              "readOnly",
              "destructive",
              "description"
            ],
            "additionalProperties": false
          }
        },
        "resources": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "uri": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "mimeType": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "requiredScopes": {
                "anyOf": [
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "policyInvalid": {
                "type": "boolean"
              }
            },
            "required": [
              "uri",
              "name",
              "description",
              "mimeType"
            ],
            "additionalProperties": false
          }
        },
        "prompts": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "requiredScopes": {
                "anyOf": [
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "policyInvalid": {
                "type": "boolean"
              }
            },
            "required": [
              "name",
              "description"
            ],
            "additionalProperties": false
          }
        },
        "custody": {
          "type": "string",
          "enum": [
            "service",
            "connection"
          ]
        },
        "provider": {
          "type": [
            "string",
            "null"
          ]
        },
        "audience": {
          "type": [
            "string",
            "null"
          ]
        },
        "maxScopes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "variables": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "header": {
                "type": "string"
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "required": {
                "type": "boolean"
              }
            },
            "required": [
              "name",
              "header",
              "description",
              "required"
            ],
            "additionalProperties": false
          }
        },
        "kind": {
          "type": "string",
          "enum": [
            "mcp",
            "rest"
          ]
        },
        "restAuth": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "location": {
                  "type": "string",
                  "enum": [
                    "header",
                    "query"
                  ]
                },
                "name": {
                  "type": "string"
                },
                "prefix": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "location",
                "name",
                "prefix"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "serverId",
        "name",
        "url",
        "transport",
        "authType",
        "enabled",
        "description",
        "tools",
        "resources",
        "prompts"
      ],
      "additionalProperties": false
    },
    "chassis": {
      "type": "object",
      "properties": {
        "synced": {
          "type": "boolean"
        },
        "error": {
          "type": [
            "string",
            "null"
          ]
        },
        "keys": {
          "type": "object",
          "properties": {
            "synced": {
              "type": "number"
            },
            "failed": {
              "type": "number"
            }
          },
          "required": [
            "synced",
            "failed"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "synced",
        "error",
        "keys"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "server",
    "chassis"
  ],
  "additionalProperties": false,
  "$defs": {
    "__schema0": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "object",
            "array",
            "string",
            "number",
            "integer",
            "boolean",
            "null"
          ]
        },
        "description": {
          "type": "string"
        },
        "properties": {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "$ref": "#/$defs/__schema0"
          }
        },
        "required": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "visible": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "items": {
          "$ref": "#/$defs/__schema0"
        },
        "enum": {
          "type": "array",
          "items": {}
        },
        "default": {}
      },
      "additionalProperties": {}
    }
  }
}

PUT /api/v1/tools/servers/{id}

tools.servers.update

یک سرور ثبت‌شده را ویرایش، غیرفعال یا فعال کنید؛ بدنه روی تعریف ذخیره‌شده ادغام می‌شود. فقط در نشست انسانی.

نقش
admin
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "serverId": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "enum": [
        "mcp",
        "rest"
      ]
    },
    "name": {
      "type": "string"
    },
    "url": {
      "type": "string"
    },
    "transport": {
      "type": "string",
      "enum": [
        "http",
        "sse"
      ]
    },
    "authType": {
      "type": "string",
      "enum": [
        "none",
        "api_key",
        "bearer_token",
        "oauth2"
      ]
    },
    "enabled": {
      "type": "boolean"
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "tools": {
      "type": "array",
      "items": {
        "type": "object",
        "propertyNames": {
          "type": "string"
        },
        "additionalProperties": {}
      }
    },
    "resources": {
      "type": "array",
      "items": {
        "type": "object",
        "propertyNames": {
          "type": "string"
        },
        "additionalProperties": {}
      }
    },
    "prompts": {
      "type": "array",
      "items": {
        "type": "object",
        "propertyNames": {
          "type": "string"
        },
        "additionalProperties": {}
      }
    },
    "variables": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "custody": {
      "type": "string",
      "enum": [
        "service",
        "connection"
      ]
    },
    "provider": {
      "type": [
        "string",
        "null"
      ]
    },
    "audience": {
      "type": [
        "string",
        "null"
      ]
    },
    "maxScopes": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "restAuth": {
      "anyOf": [
        {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {}
        },
        {
          "type": "null"
        }
      ]
    },
    "credential": {
      "type": [
        "string",
        "null"
      ]
    },
    "clearCredential": {
      "type": "boolean"
    }
  }
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "server": {
      "type": "object",
      "properties": {
        "serverId": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "url": {
          "type": "string"
        },
        "transport": {
          "type": "string",
          "enum": [
            "http",
            "sse"
          ]
        },
        "authType": {
          "type": "string",
          "enum": [
            "none",
            "api_key",
            "bearer_token",
            "oauth2"
          ]
        },
        "enabled": {
          "type": "boolean"
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "tools": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "readOnly": {
                "type": "boolean"
              },
              "destructive": {
                "type": "boolean"
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "requiredScopes": {
                "anyOf": [
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "mask": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "rateLimit": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "requests": {
                        "type": "number"
                      },
                      "windowSeconds": {
                        "type": "number"
                      }
                    },
                    "required": [
                      "requests",
                      "windowSeconds"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "requiresApproval": {
                "type": "boolean"
              },
              "allowedParams": {
                "anyOf": [
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "rest": {
                "type": "object",
                "properties": {
                  "method": {
                    "type": "string",
                    "enum": [
                      "GET",
                      "POST",
                      "PUT",
                      "PATCH",
                      "DELETE"
                    ]
                  },
                  "path": {
                    "type": "string"
                  },
                  "parameters": {
                    "$ref": "#/$defs/__schema0"
                  }
                },
                "required": [
                  "method",
                  "path",
                  "parameters"
                ],
                "additionalProperties": false
              },
              "policyInvalid": {
                "type": "boolean"
              }
            },
            "required": [
              "name",
              "readOnly",
              "destructive",
              "description"
            ],
            "additionalProperties": false
          }
        },
        "resources": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "uri": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "mimeType": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "requiredScopes": {
                "anyOf": [
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "policyInvalid": {
                "type": "boolean"
              }
            },
            "required": [
              "uri",
              "name",
              "description",
              "mimeType"
            ],
            "additionalProperties": false
          }
        },
        "prompts": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "requiredScopes": {
                "anyOf": [
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "policyInvalid": {
                "type": "boolean"
              }
            },
            "required": [
              "name",
              "description"
            ],
            "additionalProperties": false
          }
        },
        "custody": {
          "type": "string",
          "enum": [
            "service",
            "connection"
          ]
        },
        "provider": {
          "type": [
            "string",
            "null"
          ]
        },
        "audience": {
          "type": [
            "string",
            "null"
          ]
        },
        "maxScopes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "variables": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "header": {
                "type": "string"
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "required": {
                "type": "boolean"
              }
            },
            "required": [
              "name",
              "header",
              "description",
              "required"
            ],
            "additionalProperties": false
          }
        },
        "kind": {
          "type": "string",
          "enum": [
            "mcp",
            "rest"
          ]
        },
        "restAuth": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "location": {
                  "type": "string",
                  "enum": [
                    "header",
                    "query"
                  ]
                },
                "name": {
                  "type": "string"
                },
                "prefix": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "location",
                "name",
                "prefix"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "serverId",
        "name",
        "url",
        "transport",
        "authType",
        "enabled",
        "description",
        "tools",
        "resources",
        "prompts"
      ],
      "additionalProperties": false
    },
    "chassis": {
      "type": "object",
      "properties": {
        "synced": {
          "type": "boolean"
        },
        "error": {
          "type": [
            "string",
            "null"
          ]
        },
        "keys": {
          "type": "object",
          "properties": {
            "synced": {
              "type": "number"
            },
            "failed": {
              "type": "number"
            }
          },
          "required": [
            "synced",
            "failed"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "synced",
        "error",
        "keys"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "server",
    "chassis"
  ],
  "additionalProperties": false,
  "$defs": {
    "__schema0": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "object",
            "array",
            "string",
            "number",
            "integer",
            "boolean",
            "null"
          ]
        },
        "description": {
          "type": "string"
        },
        "properties": {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "$ref": "#/$defs/__schema0"
          }
        },
        "required": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "visible": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "items": {
          "$ref": "#/$defs/__schema0"
        },
        "enum": {
          "type": "array",
          "items": {}
        },
        "default": {}
      },
      "additionalProperties": {}
    }
  }
}

DELETE /api/v1/tools/servers/{id}

tools.servers.delete

یک سرور ثبت‌شده را حذف کنید. مجوزهایی که نام آن را دارند می‌مانند و بی‌اثر می‌شوند. فقط در نشست انسانی.

نقش
admin
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    },
    "chassis": {
      "type": "object",
      "properties": {
        "synced": {
          "type": "boolean"
        },
        "error": {
          "type": [
            "string",
            "null"
          ]
        },
        "keys": {
          "type": "object",
          "properties": {
            "synced": {
              "type": "number"
            },
            "failed": {
              "type": "number"
            }
          },
          "required": [
            "synced",
            "failed"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "synced",
        "error",
        "keys"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "ok",
    "chassis"
  ],
  "additionalProperties": false
}

GET /api/v1/tools/servers/{id}/discover

tools.servers.discover

آنچه یک سرور MCP اکنون ارائه می‌کند را با اعتبارنامهٔ سرویس فهرست و با اعلام‌شده مقایسه کنید. چیزی نمی‌نویسد. فقط در نشست انسانی.

نقش
admin
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "serverId": {
      "type": "string"
    },
    "separator": {
      "type": "string"
    },
    "tools": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "served",
              "undeclared",
              "missing"
            ]
          },
          "offered": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "chassisName": {
                    "type": "string"
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "params": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "readOnlyHint": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  },
                  "destructiveHint": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  }
                },
                "required": [
                  "chassisName",
                  "description",
                  "params",
                  "readOnlyHint",
                  "destructiveHint"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "declaredReadOnly": {
            "type": [
              "boolean",
              "null"
            ]
          }
        },
        "required": [
          "name",
          "status",
          "offered",
          "declaredReadOnly"
        ],
        "additionalProperties": false
      }
    },
    "unprefixed": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "serverId",
    "separator",
    "tools",
    "unprefixed"
  ],
  "additionalProperties": false
}

POST /api/v1/teams

teams.upsert

تیمی بسازید که یک کلید بتواند عضو آن شود، یا نام آن را تغییر دهید. فقط در نشست انسانی.

نقش
admin
تکرار بی‌خطر
✓
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "teamId": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "teamId",
    "name"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "team": {
      "type": "object",
      "properties": {
        "teamId": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "createdAt": {
          "type": "string"
        },
        "updatedAt": {
          "type": "string"
        }
      },
      "required": [
        "teamId",
        "name",
        "description",
        "createdAt",
        "updatedAt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "team"
  ],
  "additionalProperties": false
}

DELETE /api/v1/teams/{id}

teams.delete

یک تیم خالی را با مجوز ابزار آن حذف کنید. تیم دارای کلید خطای ۴۰۹ می‌دهد. فقط در نشست انسانی.

نقش
admin
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    }
  },
  "required": [
    "ok"
  ],
  "additionalProperties": false
}

POST /api/v1/teams/tools

teams.tools.set

مجوز ابزار یک تیم را تعیین کنید و آن را برای همهٔ کلیدهای عضو همگام کنید. فقط در نشست انسانی.

نقش
admin
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "teamId": {
      "type": "string",
      "minLength": 1
    },
    "servers": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tools": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "resources": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "prompts": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "groups": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "readOnly": {
      "type": "boolean"
    }
  },
  "required": [
    "teamId",
    "servers",
    "tools",
    "readOnly"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "access": {
      "type": "object",
      "properties": {
        "servers": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "tools": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "resources": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "prompts": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "groups": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "readOnly": {
          "type": "boolean"
        },
        "version": {
          "type": "number"
        },
        "syncedVersion": {
          "type": [
            "number",
            "null"
          ]
        },
        "syncedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "syncError": {
          "type": [
            "string",
            "null"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "none",
            "drift",
            "ready"
          ]
        }
      },
      "required": [
        "servers",
        "tools",
        "resources",
        "prompts",
        "groups",
        "readOnly",
        "version",
        "syncedVersion",
        "syncedAt",
        "syncError",
        "status"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "access"
  ],
  "additionalProperties": false
}

POST /api/v1/teams/tools/resync

teams.tools.resync

مجوز ذخیره‌شدهٔ یک تیم را پس از همگام‌سازی ناموفق دوباره برای کلیدهای عضو بفرستید. فقط در نشست انسانی.

نقش
admin
تکرار بی‌خطر
✓
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "teamId": {
      "type": "string",
      "minLength": 1
    }
  },
  "required": [
    "teamId"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "access": {
      "type": "object",
      "properties": {
        "servers": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "tools": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "resources": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "prompts": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "groups": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "readOnly": {
          "type": "boolean"
        },
        "version": {
          "type": "number"
        },
        "syncedVersion": {
          "type": [
            "number",
            "null"
          ]
        },
        "syncedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "syncError": {
          "type": [
            "string",
            "null"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "none",
            "drift",
            "ready"
          ]
        }
      },
      "required": [
        "servers",
        "tools",
        "resources",
        "prompts",
        "groups",
        "readOnly",
        "version",
        "syncedVersion",
        "syncedAt",
        "syncError",
        "status"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "access"
  ],
  "additionalProperties": false
}

DELETE /api/v1/teams/tools

teams.tools.revoke

مجوز ابزار یک تیم را حذف کنید؛ کلیدهای عضو دیگر هیچ ابزاری ندارند. فقط در نشست انسانی.

نقش
admin
تکرار بی‌خطر
✓
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    }
  },
  "required": [
    "ok"
  ],
  "additionalProperties": false
}

POST /api/v1/tools/groups

tools.groups.upsert

یک گروه ابزار بسازید یا جایگزین کنید؛ مجوزهایی که نام آن را دارند در همان درخواست همگام می‌شوند. فقط در نشست انسانی.

نقش
admin
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "groupId": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "servers": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tools": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "resources": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "prompts": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "groupId",
    "name"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "group": {
      "type": "object",
      "properties": {
        "groupId": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "servers": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "tools": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "resources": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "prompts": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "updatedAt": {
          "type": "string"
        }
      },
      "required": [
        "groupId",
        "name",
        "description",
        "servers",
        "tools",
        "resources",
        "prompts",
        "updatedAt"
      ],
      "additionalProperties": false
    },
    "sync": {
      "type": "object",
      "properties": {
        "synced": {
          "type": "number"
        },
        "failed": {
          "type": "number"
        },
        "affected": {
          "type": "number"
        }
      },
      "required": [
        "synced",
        "failed",
        "affected"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "group",
    "sync"
  ],
  "additionalProperties": false
}

DELETE /api/v1/tools/groups/{id}

tools.groups.delete

یک گروه ابزار را حذف کنید؛ مجوزهایی که نام آن را دارند دیگر چیزی از آن نمی‌گیرند. فقط در نشست انسانی.

نقش
admin
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    },
    "sync": {
      "type": "object",
      "properties": {
        "synced": {
          "type": "number"
        },
        "failed": {
          "type": "number"
        },
        "affected": {
          "type": "number"
        }
      },
      "required": [
        "synced",
        "failed",
        "affected"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "ok",
    "sync"
  ],
  "additionalProperties": false
}

POST /api/v1/tools/virtual-servers

tools.virtual-servers.upsert

یک سرور مجازی بسازید یا جایگزین کنید: مجموعه‌ابزاری که یک عامل در ‎/mcp/{serverId}‎ سوار می‌کند. فقط در نشست انسانی.

نقش
admin
تکرار بی‌خطر
✓
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "serverId": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "servers": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tools": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "resources": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "prompts": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "groups": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "disclosure": {
      "type": "string",
      "enum": [
        "all",
        "progressive"
      ]
    },
    "enabled": {
      "type": "boolean"
    }
  },
  "required": [
    "serverId",
    "name"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "virtualServer": {
      "type": "object",
      "properties": {
        "serverId": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "servers": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "tools": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "resources": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "prompts": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "groups": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "disclosure": {
          "type": "string",
          "enum": [
            "all",
            "progressive"
          ]
        },
        "enabled": {
          "type": "boolean"
        },
        "createdAt": {
          "type": "string"
        },
        "updatedAt": {
          "type": "string"
        }
      },
      "required": [
        "serverId",
        "name",
        "description",
        "servers",
        "tools",
        "resources",
        "prompts",
        "groups",
        "disclosure",
        "enabled",
        "createdAt",
        "updatedAt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "virtualServer"
  ],
  "additionalProperties": false
}

DELETE /api/v1/tools/virtual-servers/{id}

tools.virtual-servers.delete

یک سرور مجازی را حذف کنید؛ نقطهٔ پایانی آن از بررسی بعدی درگاه ۴۰۴ می‌دهد. فقط در نشست انسانی.

نقش
admin
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    }
  },
  "required": [
    "ok"
  ],
  "additionalProperties": false
}

PUT /api/v1/tools/variables

tools.variables.set

متغیرهای یک کلید حساب سرویس را برای یک سرور جایگزین کنید؛ این تعیین می‌کند فراخوانی‌هایش کجا می‌روند. فقط در نشست انسانی.

نقش
admin
تکرار بی‌خطر
✓
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "keyId": {
      "type": "string",
      "minLength": 1
    },
    "serverId": {
      "type": "string",
      "minLength": 1
    },
    "values": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {}
    }
  },
  "required": [
    "keyId",
    "serverId",
    "values"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "serverId": {
      "type": "string"
    },
    "set": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "refused": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "note": {
      "type": "string"
    }
  },
  "required": [
    "serverId",
    "set",
    "refused"
  ],
  "additionalProperties": false
}

GET /api/v1/tools/approvals

tools.approvals.list

فراخوانی‌های ابزاری را که منتظر تأیید مانده‌اند، از جدید به قدیم و تا وقتی باز هستند با آرگومان‌هایشان فهرست کنید. فقط در نشست انسانی.

نقش
admin
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "rows": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "toolCallId": {
            "type": "number"
          },
          "keyId": {
            "type": "string"
          },
          "subjectType": {
            "type": "string",
            "enum": [
              "human",
              "workload"
            ]
          },
          "subjectId": {
            "type": "string"
          },
          "server": {
            "type": "string"
          },
          "tool": {
            "type": "string"
          },
          "argsHash": {
            "type": "string"
          },
          "arguments": {},
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "approved",
              "consumed",
              "rejected",
              "cancelled",
              "expired"
            ]
          },
          "createdAt": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string"
          },
          "decidedBy": {
            "type": [
              "string",
              "null"
            ]
          },
          "decidedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "consumedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "reportedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "subjectName": {
            "type": [
              "string",
              "null"
            ]
          },
          "subjectEmail": {
            "type": [
              "string",
              "null"
            ]
          },
          "decidedByName": {
            "type": [
              "string",
              "null"
            ]
          },
          "selfDecided": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "toolCallId",
          "keyId",
          "subjectType",
          "subjectId",
          "server",
          "tool",
          "argsHash",
          "arguments",
          "status",
          "createdAt",
          "expiresAt",
          "decidedBy",
          "decidedAt",
          "consumedAt",
          "reportedAt",
          "subjectName",
          "subjectEmail",
          "decidedByName",
          "selfDecided"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "rows"
  ],
  "additionalProperties": false
}

POST /api/v1/tools/approvals/{id}

tools.approvals.decide

یک فراخوانی ابزار منتظر را تأیید، رد یا پس بگیرید. اینجا چیزی اجرا نمی‌شود؛ ردیفی که تغییر کرده خطای ۴۰۹ می‌دهد. فقط در نشست انسانی.

نقش
admin
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "decision": {
      "type": "string",
      "enum": [
        "approve",
        "reject",
        "cancel"
      ]
    }
  },
  "required": [
    "decision"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "approval": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "toolCallId": {
          "type": "number"
        },
        "keyId": {
          "type": "string"
        },
        "subjectType": {
          "type": "string",
          "enum": [
            "human",
            "workload"
          ]
        },
        "subjectId": {
          "type": "string"
        },
        "server": {
          "type": "string"
        },
        "tool": {
          "type": "string"
        },
        "argsHash": {
          "type": "string"
        },
        "arguments": {},
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "approved",
            "consumed",
            "rejected",
            "cancelled",
            "expired"
          ]
        },
        "createdAt": {
          "type": "string"
        },
        "expiresAt": {
          "type": "string"
        },
        "decidedBy": {
          "type": [
            "string",
            "null"
          ]
        },
        "decidedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "consumedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "reportedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "subjectName": {
          "type": [
            "string",
            "null"
          ]
        },
        "subjectEmail": {
          "type": [
            "string",
            "null"
          ]
        },
        "decidedByName": {
          "type": [
            "string",
            "null"
          ]
        },
        "selfDecided": {
          "type": "boolean"
        }
      },
      "required": [
        "id",
        "toolCallId",
        "keyId",
        "subjectType",
        "subjectId",
        "server",
        "tool",
        "argsHash",
        "arguments",
        "status",
        "createdAt",
        "expiresAt",
        "decidedBy",
        "decidedAt",
        "consumedAt",
        "reportedAt",
        "subjectName",
        "subjectEmail",
        "decidedByName",
        "selfDecided"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "approval"
  ],
  "additionalProperties": false
}

POST /api/v1/connections

connections.start

رضایت‌دادن برای یک کلید حساب سرویس را آغاز کنید؛ پاسخ نشانی‌ای است که مرورگر در آن رضایت می‌دهد. فقط در نشست انسانی.

نقش
admin
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "provider": {
      "type": "string",
      "minLength": 1
    },
    "keyId": {
      "type": "string",
      "minLength": 1
    },
    "scopes": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        {
          "type": "string"
        }
      ]
    }
  },
  "required": [
    "provider",
    "keyId"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "url": {
      "type": "string"
    }
  },
  "required": [
    "url"
  ],
  "additionalProperties": false
}

DELETE /api/v1/connections/{id}

connections.revoke

هر اتصالی را به‌صورت محلی لغو کنید؛ درگاه آن را در بالادست هم لغو می‌کند. فقط در نشست انسانی.

نقش
admin
تکرار بی‌خطر
✓
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    }
  },
  "required": [
    "ok"
  ],
  "additionalProperties": false
}

POST /api/v1/connections/providers

connections.providers.create

یک ارائه‌دهندهٔ OAuth ثبت کنید؛ رمز کلاینت برای درگاه مهر و موم می‌شود. شناسهٔ تکراری خطای ۴۰۹ می‌دهد. فقط در نشست انسانی.

نقش
admin
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "provider": {
      "type": "string"
    },
    "displayName": {
      "type": "string"
    },
    "authorizationUrl": {
      "type": "string"
    },
    "tokenUrl": {
      "type": "string"
    },
    "revocationUrl": {
      "type": [
        "string",
        "null"
      ]
    },
    "clientId": {
      "type": "string"
    },
    "audience": {
      "type": "string"
    },
    "defaultScopes": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "enabled": {
      "type": "boolean"
    },
    "clientSecret": {
      "type": "string"
    }
  },
  "required": [
    "provider",
    "displayName",
    "authorizationUrl",
    "tokenUrl",
    "clientId",
    "audience"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    }
  },
  "required": [
    "ok"
  ],
  "additionalProperties": false
}

PUT /api/v1/connections/providers/{id}

connections.providers.update

نشانی‌ها، کلاینت یا رمز یک ارائه‌دهنده را ویرایش کنید؛ تغییر مخاطب رمز را دوباره لازم دارد. فقط در نشست انسانی.

نقش
admin
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "provider": {
      "type": "string"
    },
    "displayName": {
      "type": "string"
    },
    "authorizationUrl": {
      "type": "string"
    },
    "tokenUrl": {
      "type": "string"
    },
    "revocationUrl": {
      "type": [
        "string",
        "null"
      ]
    },
    "clientId": {
      "type": "string"
    },
    "audience": {
      "type": "string"
    },
    "defaultScopes": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "enabled": {
      "type": "boolean"
    },
    "clientSecret": {
      "type": "string"
    }
  }
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    }
  },
  "required": [
    "ok"
  ],
  "additionalProperties": false
}

DELETE /api/v1/connections/providers/{id}

connections.providers.delete

یک ارائه‌دهندهٔ OAuth را حذف کنید. فقط در نشست انسانی.

نقش
admin
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    }
  },
  "required": [
    "ok"
  ],
  "additionalProperties": false
}

GET /api/v1/context-packs

packs.list

بسته‌های زمینه را فهرست کنید: سیاست دسترسی، نسخه‌های منتشرشده و بازنشسته با هش آن‌ها، تخصیص‌ها و تنظیمات. هرگز متن یک نسخه یا پیش‌نویس.

نقش
viewer
دامنه
packs:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "packs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "packId": {
            "type": "string"
          },
          "tenant": {
            "type": "string"
          },
          "ownerUserId": {
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "classification": {
            "type": "string",
            "enum": [
              "public",
              "internal",
              "confidential"
            ]
          },
          "accessPolicy": {
            "type": "object",
            "properties": {
              "keys": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "subjectTypes": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "human",
                    "workload"
                  ]
                }
              }
            },
            "required": [
              "keys",
              "subjectTypes"
            ],
            "additionalProperties": false
          },
          "enabled": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "ownerEmail": {
            "type": [
              "string",
              "null"
            ]
          },
          "versions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "versionId": {
                  "type": "string"
                },
                "seq": {
                  "type": "number"
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "draft",
                    "published",
                    "retired"
                  ]
                },
                "hash": {
                  "type": "string"
                },
                "mimeType": {
                  "type": "string"
                },
                "locale": {
                  "type": "string"
                },
                "createdAt": {
                  "type": "string"
                },
                "publishedAt": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "retiredAt": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "versionId",
                "seq",
                "state",
                "hash",
                "mimeType",
                "locale",
                "createdAt",
                "publishedAt",
                "retiredAt"
              ],
              "additionalProperties": false
            }
          },
          "assignments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "assignmentId": {
                  "type": "string"
                },
                "packId": {
                  "type": "string"
                },
                "selectorKind": {
                  "type": "string",
                  "enum": [
                    "any",
                    "key",
                    "user"
                  ]
                },
                "selectorId": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "route": {
                  "type": "string"
                },
                "pinnedVersionId": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "priority": {
                  "type": "number"
                },
                "budgetTokens": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "delivery": {
                  "type": "string",
                  "enum": [
                    "whole",
                    "retrieve"
                  ]
                },
                "enabled": {
                  "type": "boolean"
                },
                "createdAt": {
                  "type": "string"
                },
                "updatedAt": {
                  "type": "string"
                }
              },
              "required": [
                "assignmentId",
                "packId",
                "selectorKind",
                "selectorId",
                "route",
                "pinnedVersionId",
                "priority",
                "budgetTokens",
                "delivery",
                "enabled",
                "createdAt",
                "updatedAt"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "packId",
          "tenant",
          "ownerUserId",
          "title",
          "description",
          "classification",
          "accessPolicy",
          "enabled",
          "createdAt",
          "updatedAt",
          "ownerEmail",
          "versions",
          "assignments"
        ],
        "additionalProperties": false
      }
    },
    "settings": {
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean"
        },
        "defaultBudgetTokens": {
          "type": [
            "number",
            "null"
          ]
        },
        "reservedOutputTokens": {
          "type": "number"
        }
      },
      "required": [
        "enabled",
        "defaultBudgetTokens",
        "reservedOutputTokens"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "packs",
    "settings"
  ],
  "additionalProperties": false
}

GET /api/v1/context-packs/{id}/versions

packs.versions.list

همهٔ نسخه‌های یک بسته را با متن، پیش‌نویس‌ها و سوابق غربالگری بخوانید. خواندن محتوای شرکت است. فقط در نشست انسانی.

نقش
viewer
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "versions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "versionId": {
            "type": "string"
          },
          "packId": {
            "type": "string"
          },
          "seq": {
            "type": "number"
          },
          "content": {
            "type": "string"
          },
          "mimeType": {
            "type": "string"
          },
          "locale": {
            "type": "string"
          },
          "hash": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "draft",
              "published",
              "retired"
            ]
          },
          "createdByUserId": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string"
          },
          "publishedByUserId": {
            "type": [
              "string",
              "null"
            ]
          },
          "publishedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "retiredAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "reviewRequestedByUserId": {
            "type": [
              "string",
              "null"
            ]
          },
          "reviewRequestedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "screening": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "screenedAt": {
                    "type": "string"
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "allow",
                      "flag",
                      "block"
                    ]
                  },
                  "screened": {
                    "type": "boolean"
                  },
                  "routes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "guards": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "coveredBy": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "unavailable": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "guard": {
                          "type": "string"
                        },
                        "category": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "guard",
                        "category"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "findings": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "guard": {
                          "type": "string"
                        },
                        "action": {
                          "type": "string"
                        },
                        "category": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "ruleId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "ruleType": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "routes": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "source": {
                          "type": "string",
                          "enum": [
                            "console",
                            "gateway"
                          ]
                        }
                      },
                      "required": [
                        "guard",
                        "action",
                        "category",
                        "ruleId",
                        "ruleType",
                        "routes",
                        "source"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "gateway": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "asked": {
                            "type": "boolean",
                            "const": false
                          }
                        },
                        "required": [
                          "asked"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "asked": {
                            "type": "boolean",
                            "const": true
                          },
                          "answered": {
                            "type": "boolean",
                            "const": true
                          }
                        },
                        "required": [
                          "asked",
                          "answered"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "asked": {
                            "type": "boolean",
                            "const": true
                          },
                          "answered": {
                            "type": "boolean",
                            "const": false
                          },
                          "error": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "asked",
                          "answered",
                          "error"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  }
                },
                "required": [
                  "screenedAt",
                  "action",
                  "screened",
                  "routes",
                  "guards",
                  "coveredBy",
                  "unavailable",
                  "findings",
                  "gateway"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "createdByEmail": {
            "type": [
              "string",
              "null"
            ]
          },
          "reviewRequestedByEmail": {
            "type": [
              "string",
              "null"
            ]
          },
          "publishedByEmail": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "versionId",
          "packId",
          "seq",
          "content",
          "mimeType",
          "locale",
          "hash",
          "state",
          "createdByUserId",
          "createdAt",
          "publishedByUserId",
          "publishedAt",
          "retiredAt",
          "reviewRequestedByUserId",
          "reviewRequestedAt",
          "screening",
          "createdByEmail",
          "reviewRequestedByEmail",
          "publishedByEmail"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "versions"
  ],
  "additionalProperties": false
}

POST /api/v1/context-packs

packs.create

یک بستهٔ زمینه بسازید. تا وقتی نسخه‌ای منتشر نشود، چیزی پیشوند نمی‌شود. فقط در نشست انسانی.

نقش
admin
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "packId": {
      "type": "string"
    },
    "title": {
      "type": "string"
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "classification": {
      "type": "string",
      "enum": [
        "public",
        "internal",
        "confidential"
      ]
    },
    "accessPolicy": {
      "type": "object",
      "properties": {
        "keys": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "subjectTypes": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "human",
              "workload"
            ]
          }
        }
      }
    },
    "enabled": {
      "type": "boolean"
    },
    "ownerUserId": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "packId",
    "title"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "pack": {
      "type": "object",
      "properties": {
        "packId": {
          "type": "string"
        },
        "tenant": {
          "type": "string"
        },
        "ownerUserId": {
          "type": [
            "string",
            "null"
          ]
        },
        "title": {
          "type": "string"
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "classification": {
          "type": "string",
          "enum": [
            "public",
            "internal",
            "confidential"
          ]
        },
        "accessPolicy": {
          "type": "object",
          "properties": {
            "keys": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "subjectTypes": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "human",
                  "workload"
                ]
              }
            }
          },
          "required": [
            "keys",
            "subjectTypes"
          ],
          "additionalProperties": false
        },
        "enabled": {
          "type": "boolean"
        },
        "createdAt": {
          "type": "string"
        },
        "updatedAt": {
          "type": "string"
        }
      },
      "required": [
        "packId",
        "tenant",
        "ownerUserId",
        "title",
        "description",
        "classification",
        "accessPolicy",
        "enabled",
        "createdAt",
        "updatedAt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "pack"
  ],
  "additionalProperties": false
}

PUT /api/v1/context-packs

packs.settings.update

تنظیمات بسته‌های زمینه را تغییر دهید: کلید اصلی و دو عدد بودجه. بدنه با تنظیمات ذخیره‌شده ادغام می‌شود. فقط در نشست انسانی.

نقش
admin
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "enabled": {
      "type": "boolean"
    },
    "defaultBudgetTokens": {
      "type": [
        "number",
        "null"
      ]
    },
    "reservedOutputTokens": {
      "type": "number"
    }
  }
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "settings": {
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean"
        },
        "defaultBudgetTokens": {
          "type": [
            "number",
            "null"
          ]
        },
        "reservedOutputTokens": {
          "type": "number"
        }
      },
      "required": [
        "enabled",
        "defaultBudgetTokens",
        "reservedOutputTokens"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "settings"
  ],
  "additionalProperties": false
}

PUT /api/v1/context-packs/{id}

packs.update

عنوان، طبقه‌بندی، سیاست دسترسی، مالک یا وضعیت یک بسته را ویرایش کنید. بدنهٔ جزئی است. فقط در نشست انسانی.

نقش
admin
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "packId": {
      "type": "string"
    },
    "title": {
      "type": "string"
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "classification": {
      "type": "string",
      "enum": [
        "public",
        "internal",
        "confidential"
      ]
    },
    "accessPolicy": {
      "type": "object",
      "properties": {
        "keys": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "subjectTypes": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "human",
              "workload"
            ]
          }
        }
      }
    },
    "enabled": {
      "type": "boolean"
    },
    "ownerUserId": {
      "type": [
        "string",
        "null"
      ]
    }
  }
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "pack": {
      "type": "object",
      "properties": {
        "packId": {
          "type": "string"
        },
        "tenant": {
          "type": "string"
        },
        "ownerUserId": {
          "type": [
            "string",
            "null"
          ]
        },
        "title": {
          "type": "string"
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "classification": {
          "type": "string",
          "enum": [
            "public",
            "internal",
            "confidential"
          ]
        },
        "accessPolicy": {
          "type": "object",
          "properties": {
            "keys": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "subjectTypes": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "human",
                  "workload"
                ]
              }
            }
          },
          "required": [
            "keys",
            "subjectTypes"
          ],
          "additionalProperties": false
        },
        "enabled": {
          "type": "boolean"
        },
        "createdAt": {
          "type": "string"
        },
        "updatedAt": {
          "type": "string"
        }
      },
      "required": [
        "packId",
        "tenant",
        "ownerUserId",
        "title",
        "description",
        "classification",
        "accessPolicy",
        "enabled",
        "createdAt",
        "updatedAt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "pack"
  ],
  "additionalProperties": false
}

DELETE /api/v1/context-packs/{id}

packs.delete

یک بسته را با نسخه‌ها و تخصیص‌هایش حذف کنید. غیرفعال‌کردن شکل برگشت‌پذیر آن است. فقط در نشست انسانی.

نقش
admin
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    }
  },
  "required": [
    "ok"
  ],
  "additionalProperties": false
}

POST /api/v1/context-packs/{id}/versions

packs.versions.create

یک نسخهٔ پیش‌نویس از یک بسته باز کنید. پیش‌نویس قابل ویرایش است و به هیچ درخواستی داده نمی‌شود. فقط در نشست انسانی.

نقش
admin
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "content": {
      "type": "string"
    },
    "mimeType": {
      "type": "string"
    },
    "locale": {
      "type": "string"
    }
  },
  "required": [
    "content"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "version": {
      "type": "object",
      "properties": {
        "versionId": {
          "type": "string"
        },
        "packId": {
          "type": "string"
        },
        "seq": {
          "type": "number"
        },
        "content": {
          "type": "string"
        },
        "mimeType": {
          "type": "string"
        },
        "locale": {
          "type": "string"
        },
        "hash": {
          "type": "string"
        },
        "state": {
          "type": "string",
          "enum": [
            "draft",
            "published",
            "retired"
          ]
        },
        "createdByUserId": {
          "type": [
            "string",
            "null"
          ]
        },
        "createdAt": {
          "type": "string"
        },
        "publishedByUserId": {
          "type": [
            "string",
            "null"
          ]
        },
        "publishedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "retiredAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "reviewRequestedByUserId": {
          "type": [
            "string",
            "null"
          ]
        },
        "reviewRequestedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "screening": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "screenedAt": {
                  "type": "string"
                },
                "action": {
                  "type": "string",
                  "enum": [
                    "allow",
                    "flag",
                    "block"
                  ]
                },
                "screened": {
                  "type": "boolean"
                },
                "routes": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "guards": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "coveredBy": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "unavailable": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "guard": {
                        "type": "string"
                      },
                      "category": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "guard",
                      "category"
                    ],
                    "additionalProperties": false
                  }
                },
                "findings": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "guard": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string"
                      },
                      "category": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ruleId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ruleType": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "routes": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "source": {
                        "type": "string",
                        "enum": [
                          "console",
                          "gateway"
                        ]
                      }
                    },
                    "required": [
                      "guard",
                      "action",
                      "category",
                      "ruleId",
                      "ruleType",
                      "routes",
                      "source"
                    ],
                    "additionalProperties": false
                  }
                },
                "gateway": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "asked": {
                          "type": "boolean",
                          "const": false
                        }
                      },
                      "required": [
                        "asked"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "asked": {
                          "type": "boolean",
                          "const": true
                        },
                        "answered": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "asked",
                        "answered"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "asked": {
                          "type": "boolean",
                          "const": true
                        },
                        "answered": {
                          "type": "boolean",
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "asked",
                        "answered",
                        "error"
                      ],
                      "additionalProperties": false
                    }
                  ]
                }
              },
              "required": [
                "screenedAt",
                "action",
                "screened",
                "routes",
                "guards",
                "coveredBy",
                "unavailable",
                "findings",
                "gateway"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "versionId",
        "packId",
        "seq",
        "content",
        "mimeType",
        "locale",
        "hash",
        "state",
        "createdByUserId",
        "createdAt",
        "publishedByUserId",
        "publishedAt",
        "retiredAt",
        "reviewRequestedByUserId",
        "reviewRequestedAt",
        "screening"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "version"
  ],
  "additionalProperties": false
}

PUT /api/v1/context-packs/{id}/versions/{versionId}

packs.versions.update

یک پیش‌نویس را ویرایش، برای بازبینی علامت‌گذاری یا منتشر کنید (ابتدا غربالگری می‌شود)، یا نسخهٔ منتشرشده را بازنشسته کنید. نسخهٔ منتشرشده هرگز تغییر نمی‌کند. فقط در نشست انسانی.

نقش
admin
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "state": {
      "type": "string",
      "enum": [
        "published",
        "retired"
      ]
    },
    "review": {
      "type": "boolean"
    },
    "content": {
      "type": "string"
    },
    "mimeType": {
      "type": "string"
    },
    "locale": {
      "type": "string"
    }
  }
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "version": {
      "type": "object",
      "properties": {
        "versionId": {
          "type": "string"
        },
        "packId": {
          "type": "string"
        },
        "seq": {
          "type": "number"
        },
        "content": {
          "type": "string"
        },
        "mimeType": {
          "type": "string"
        },
        "locale": {
          "type": "string"
        },
        "hash": {
          "type": "string"
        },
        "state": {
          "type": "string",
          "enum": [
            "draft",
            "published",
            "retired"
          ]
        },
        "createdByUserId": {
          "type": [
            "string",
            "null"
          ]
        },
        "createdAt": {
          "type": "string"
        },
        "publishedByUserId": {
          "type": [
            "string",
            "null"
          ]
        },
        "publishedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "retiredAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "reviewRequestedByUserId": {
          "type": [
            "string",
            "null"
          ]
        },
        "reviewRequestedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "screening": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "screenedAt": {
                  "type": "string"
                },
                "action": {
                  "type": "string",
                  "enum": [
                    "allow",
                    "flag",
                    "block"
                  ]
                },
                "screened": {
                  "type": "boolean"
                },
                "routes": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "guards": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "coveredBy": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "unavailable": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "guard": {
                        "type": "string"
                      },
                      "category": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "guard",
                      "category"
                    ],
                    "additionalProperties": false
                  }
                },
                "findings": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "guard": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string"
                      },
                      "category": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ruleId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ruleType": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "routes": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "source": {
                        "type": "string",
                        "enum": [
                          "console",
                          "gateway"
                        ]
                      }
                    },
                    "required": [
                      "guard",
                      "action",
                      "category",
                      "ruleId",
                      "ruleType",
                      "routes",
                      "source"
                    ],
                    "additionalProperties": false
                  }
                },
                "gateway": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "asked": {
                          "type": "boolean",
                          "const": false
                        }
                      },
                      "required": [
                        "asked"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "asked": {
                          "type": "boolean",
                          "const": true
                        },
                        "answered": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "asked",
                        "answered"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "asked": {
                          "type": "boolean",
                          "const": true
                        },
                        "answered": {
                          "type": "boolean",
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "asked",
                        "answered",
                        "error"
                      ],
                      "additionalProperties": false
                    }
                  ]
                }
              },
              "required": [
                "screenedAt",
                "action",
                "screened",
                "routes",
                "guards",
                "coveredBy",
                "unavailable",
                "findings",
                "gateway"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "versionId",
        "packId",
        "seq",
        "content",
        "mimeType",
        "locale",
        "hash",
        "state",
        "createdByUserId",
        "createdAt",
        "publishedByUserId",
        "publishedAt",
        "retiredAt",
        "reviewRequestedByUserId",
        "reviewRequestedAt",
        "screening"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "version"
  ],
  "additionalProperties": false
}

DELETE /api/v1/context-packs/{id}/versions/{versionId}

packs.versions.delete

یک پیش‌نویس را حذف کنید. نسخهٔ منتشرشده یا بازنشسته سابقه است و می‌ماند. فقط در نشست انسانی.

نقش
admin
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    }
  },
  "required": [
    "ok"
  ],
  "additionalProperties": false
}

POST /api/v1/context-packs/{id}/assignments

packs.assignments.create

یک بسته را به یک (انتخاب‌گر، مسیر) تخصیص دهید: جایی که ارائه می‌شود. چه کسی آن را می‌بیند را سیاست دسترسی خود بسته تعیین می‌کند. فقط در نشست انسانی.

نقش
admin
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "selectorKind": {
      "type": "string",
      "enum": [
        "any",
        "key",
        "user"
      ]
    },
    "selectorId": {
      "type": [
        "string",
        "null"
      ]
    },
    "route": {
      "type": "string"
    },
    "pinnedVersionId": {
      "type": [
        "string",
        "null"
      ]
    },
    "priority": {
      "type": "number"
    },
    "budgetTokens": {
      "type": [
        "number",
        "null"
      ]
    },
    "delivery": {
      "type": "string",
      "enum": [
        "whole",
        "retrieve"
      ]
    },
    "enabled": {
      "type": "boolean"
    }
  },
  "required": [
    "selectorKind",
    "route"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "assignment": {
      "type": "object",
      "properties": {
        "assignmentId": {
          "type": "string"
        },
        "packId": {
          "type": "string"
        },
        "selectorKind": {
          "type": "string",
          "enum": [
            "any",
            "key",
            "user"
          ]
        },
        "selectorId": {
          "type": [
            "string",
            "null"
          ]
        },
        "route": {
          "type": "string"
        },
        "pinnedVersionId": {
          "type": [
            "string",
            "null"
          ]
        },
        "priority": {
          "type": "number"
        },
        "budgetTokens": {
          "type": [
            "number",
            "null"
          ]
        },
        "delivery": {
          "type": "string",
          "enum": [
            "whole",
            "retrieve"
          ]
        },
        "enabled": {
          "type": "boolean"
        },
        "createdAt": {
          "type": "string"
        },
        "updatedAt": {
          "type": "string"
        }
      },
      "required": [
        "assignmentId",
        "packId",
        "selectorKind",
        "selectorId",
        "route",
        "pinnedVersionId",
        "priority",
        "budgetTokens",
        "delivery",
        "enabled",
        "createdAt",
        "updatedAt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "assignment"
  ],
  "additionalProperties": false
}

PUT /api/v1/context-packs/{id}/assignments/{assignmentId}

packs.assignments.update

یک تخصیص را در جای خود ویرایش کنید. بدنهٔ جزئی است. فقط در نشست انسانی.

نقش
admin
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "selectorKind": {
      "type": "string",
      "enum": [
        "any",
        "key",
        "user"
      ]
    },
    "selectorId": {
      "type": [
        "string",
        "null"
      ]
    },
    "route": {
      "type": "string"
    },
    "pinnedVersionId": {
      "type": [
        "string",
        "null"
      ]
    },
    "priority": {
      "type": "number"
    },
    "budgetTokens": {
      "type": [
        "number",
        "null"
      ]
    },
    "delivery": {
      "type": "string",
      "enum": [
        "whole",
        "retrieve"
      ]
    },
    "enabled": {
      "type": "boolean"
    }
  }
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "assignment": {
      "type": "object",
      "properties": {
        "assignmentId": {
          "type": "string"
        },
        "packId": {
          "type": "string"
        },
        "selectorKind": {
          "type": "string",
          "enum": [
            "any",
            "key",
            "user"
          ]
        },
        "selectorId": {
          "type": [
            "string",
            "null"
          ]
        },
        "route": {
          "type": "string"
        },
        "pinnedVersionId": {
          "type": [
            "string",
            "null"
          ]
        },
        "priority": {
          "type": "number"
        },
        "budgetTokens": {
          "type": [
            "number",
            "null"
          ]
        },
        "delivery": {
          "type": "string",
          "enum": [
            "whole",
            "retrieve"
          ]
        },
        "enabled": {
          "type": "boolean"
        },
        "createdAt": {
          "type": "string"
        },
        "updatedAt": {
          "type": "string"
        }
      },
      "required": [
        "assignmentId",
        "packId",
        "selectorKind",
        "selectorId",
        "route",
        "pinnedVersionId",
        "priority",
        "budgetTokens",
        "delivery",
        "enabled",
        "createdAt",
        "updatedAt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "assignment"
  ],
  "additionalProperties": false
}

DELETE /api/v1/context-packs/{id}/assignments/{assignmentId}

packs.assignments.delete

یک تخصیص را حذف کنید. فقط در نشست انسانی.

نقش
admin
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    }
  },
  "required": [
    "ok"
  ],
  "additionalProperties": false
}

GET /api/v1/skills

skills.list

مهارت‌های شرکت را فهرست کنید: چه کسی هر کدام را انتخاب می‌کند، و عنوان، چکیده و نیازمندی‌های اعلام‌شدهٔ هر نسخهٔ منتشرشده یا بازنشسته. هرگز متن روال، پیش‌نویس یا نظر بازبینی.

نقش
viewer
دامنه
skills:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "skills": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "skillId": {
            "type": "string"
          },
          "tenant": {
            "type": "string"
          },
          "ownerUserId": {
            "type": [
              "string",
              "null"
            ]
          },
          "accessPolicy": {
            "type": "object",
            "properties": {
              "keys": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "subjectTypes": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "human",
                    "workload"
                  ]
                }
              }
            },
            "required": [
              "keys",
              "subjectTypes"
            ],
            "additionalProperties": false
          },
          "enabled": {
            "type": "boolean"
          },
          "invalid": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "promptName": {
            "type": "string"
          },
          "ownerEmail": {
            "type": [
              "string",
              "null"
            ]
          },
          "versions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "versionId": {
                  "type": "string"
                },
                "seq": {
                  "type": "number"
                },
                "title": {
                  "type": "string"
                },
                "digest": {
                  "type": "string"
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "draft",
                    "published",
                    "retired"
                  ]
                },
                "requires": {
                  "type": "object",
                  "properties": {
                    "tools": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "resources": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "prompts": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "tools",
                    "resources",
                    "prompts"
                  ],
                  "additionalProperties": false
                },
                "compatibility": {
                  "type": "object",
                  "properties": {
                    "clients": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "notes": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "clients",
                    "notes"
                  ],
                  "additionalProperties": false
                },
                "reviewed": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "primitive": {
                        "type": "string",
                        "enum": [
                          "tool",
                          "resource",
                          "prompt"
                        ]
                      },
                      "name": {
                        "type": "string"
                      },
                      "readOnly": {
                        "type": "boolean"
                      },
                      "requiredScopes": {
                        "anyOf": [
                          {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "custody": {
                        "type": "string",
                        "enum": [
                          "service",
                          "connection"
                        ]
                      }
                    },
                    "required": [
                      "primitive",
                      "name",
                      "readOnly",
                      "requiredScopes",
                      "custody"
                    ],
                    "additionalProperties": false
                  }
                },
                "selfReviewed": {
                  "type": "boolean"
                },
                "publishedAt": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "publishedByEmail": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "retiredAt": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "invalid": {
                  "type": "boolean"
                }
              },
              "required": [
                "versionId",
                "seq",
                "title",
                "digest",
                "state",
                "requires",
                "compatibility",
                "reviewed",
                "selfReviewed",
                "publishedAt",
                "publishedByEmail",
                "retiredAt"
              ],
              "additionalProperties": false
            }
          },
          "servedVersionId": {
            "type": [
              "string",
              "null"
            ]
          },
          "rollbackVersionId": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "skillId",
          "tenant",
          "ownerUserId",
          "accessPolicy",
          "enabled",
          "createdAt",
          "updatedAt",
          "promptName",
          "ownerEmail",
          "versions",
          "servedVersionId",
          "rollbackVersionId"
        ],
        "additionalProperties": false
      }
    },
    "settings": {
      "type": "object",
      "properties": {
        "allowSelfPublish": {
          "type": "boolean"
        }
      },
      "required": [
        "allowSelfPublish"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "skills",
    "settings"
  ],
  "additionalProperties": false
}

GET /api/v1/skills/{id}/versions

skills.versions.list

همهٔ نسخه‌های یک مهارت را با روال، پیش‌نویس‌ها و نظرهای بازبینی بخوانید. خواندن محتوای شرکت است. فقط در نشست انسانی.

نقش
viewer
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "versions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "versionId": {
            "type": "string"
          },
          "skillId": {
            "type": "string"
          },
          "seq": {
            "type": "number"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "requires": {
            "type": "object",
            "properties": {
              "tools": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "resources": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "prompts": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "tools",
              "resources",
              "prompts"
            ],
            "additionalProperties": false
          },
          "compatibility": {
            "type": "object",
            "properties": {
              "clients": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "notes": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "clients",
              "notes"
            ],
            "additionalProperties": false
          },
          "digest": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "draft",
              "published",
              "retired"
            ]
          },
          "reviewed": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "primitive": {
                  "type": "string",
                  "enum": [
                    "tool",
                    "resource",
                    "prompt"
                  ]
                },
                "name": {
                  "type": "string"
                },
                "readOnly": {
                  "type": "boolean"
                },
                "requiredScopes": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "custody": {
                  "type": "string",
                  "enum": [
                    "service",
                    "connection"
                  ]
                }
              },
              "required": [
                "primitive",
                "name",
                "readOnly",
                "requiredScopes",
                "custody"
              ],
              "additionalProperties": false
            }
          },
          "publishedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "publishedByEmail": {
            "type": [
              "string",
              "null"
            ]
          },
          "invalid": {
            "type": "boolean"
          },
          "createdByUserId": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string"
          },
          "lastEditedByUserId": {
            "type": [
              "string",
              "null"
            ]
          },
          "updatedAt": {
            "type": "string"
          },
          "reviewRequestedByUserId": {
            "type": [
              "string",
              "null"
            ]
          },
          "reviewRequestedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "reviewDigest": {
            "type": [
              "string",
              "null"
            ]
          },
          "screening": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "screenedAt": {
                    "type": "string"
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "allow",
                      "flag",
                      "block"
                    ]
                  },
                  "screened": {
                    "type": "boolean"
                  },
                  "routes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "guards": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "coveredBy": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "unavailable": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "guard": {
                          "type": "string"
                        },
                        "category": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "guard",
                        "category"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "findings": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "guard": {
                          "type": "string"
                        },
                        "action": {
                          "type": "string"
                        },
                        "category": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "ruleId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "ruleType": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "routes": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "source": {
                          "type": "string",
                          "enum": [
                            "console",
                            "gateway"
                          ]
                        }
                      },
                      "required": [
                        "guard",
                        "action",
                        "category",
                        "ruleId",
                        "ruleType",
                        "routes",
                        "source"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "gateway": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "asked": {
                            "type": "boolean",
                            "const": false
                          }
                        },
                        "required": [
                          "asked"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "asked": {
                            "type": "boolean",
                            "const": true
                          },
                          "answered": {
                            "type": "boolean",
                            "const": true
                          }
                        },
                        "required": [
                          "asked",
                          "answered"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "asked": {
                            "type": "boolean",
                            "const": true
                          },
                          "answered": {
                            "type": "boolean",
                            "const": false
                          },
                          "error": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "asked",
                          "answered",
                          "error"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  }
                },
                "required": [
                  "screenedAt",
                  "action",
                  "screened",
                  "routes",
                  "guards",
                  "coveredBy",
                  "unavailable",
                  "findings",
                  "gateway"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "publishedByUserId": {
            "type": [
              "string",
              "null"
            ]
          },
          "retiredByUserId": {
            "type": [
              "string",
              "null"
            ]
          },
          "retiredAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "reviewerUserId": {
            "type": [
              "string",
              "null"
            ]
          },
          "changesRequestedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "changesRequestedContent": {
            "type": [
              "string",
              "null"
            ]
          },
          "selfReviewed": {
            "type": "boolean"
          },
          "contributorUserIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "createdByEmail": {
            "type": [
              "string",
              "null"
            ]
          },
          "lastEditedByEmail": {
            "type": [
              "string",
              "null"
            ]
          },
          "reviewRequestedByEmail": {
            "type": [
              "string",
              "null"
            ]
          },
          "reviewerEmail": {
            "type": [
              "string",
              "null"
            ]
          },
          "retiredByEmail": {
            "type": [
              "string",
              "null"
            ]
          },
          "contributorEmails": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "comments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "commentId": {
                  "type": "string"
                },
                "versionId": {
                  "type": "string"
                },
                "digest": {
                  "type": "string"
                },
                "line": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "quote": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "body": {
                  "type": "string"
                },
                "authorUserId": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "authorEmail": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "open",
                    "resolved"
                  ]
                },
                "reply": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "resolvedByUserId": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "resolvedAt": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "createdAt": {
                  "type": "string"
                }
              },
              "required": [
                "commentId",
                "versionId",
                "digest",
                "line",
                "quote",
                "body",
                "authorUserId",
                "authorEmail",
                "state",
                "reply",
                "resolvedByUserId",
                "resolvedAt",
                "createdAt"
              ],
              "additionalProperties": false
            }
          },
          "reviewText": {
            "type": "string"
          },
          "undeclaredMentions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "versionId",
          "skillId",
          "seq",
          "title",
          "description",
          "content",
          "requires",
          "compatibility",
          "digest",
          "state",
          "reviewed",
          "publishedAt",
          "publishedByEmail",
          "createdByUserId",
          "createdAt",
          "lastEditedByUserId",
          "updatedAt",
          "reviewRequestedByUserId",
          "reviewRequestedAt",
          "reviewDigest",
          "screening",
          "publishedByUserId",
          "retiredByUserId",
          "retiredAt",
          "reviewerUserId",
          "changesRequestedAt",
          "changesRequestedContent",
          "selfReviewed",
          "contributorUserIds",
          "createdByEmail",
          "lastEditedByEmail",
          "reviewRequestedByEmail",
          "reviewerEmail",
          "retiredByEmail",
          "contributorEmails",
          "comments",
          "reviewText",
          "undeclaredMentions"
        ],
        "additionalProperties": false
      }
    },
    "choices": {
      "type": "object",
      "properties": {
        "tools": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "resources": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "prompts": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "tools",
        "resources",
        "prompts"
      ],
      "additionalProperties": false
    },
    "reviewers": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "email",
          "name"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "versions",
    "choices",
    "reviewers"
  ],
  "additionalProperties": false
}

POST /api/v1/skills

skills.create

یک مهارت بسازید. تا وقتی نسخه‌ای منتشر نشود، هیچ‌کس آن را انتخاب نمی‌کند. فقط در نشست انسانی.

نقش
admin
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "skillId": {
      "type": "string"
    },
    "accessPolicy": {
      "type": "object",
      "properties": {
        "keys": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "subjectTypes": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "human",
              "workload"
            ]
          }
        }
      }
    },
    "enabled": {
      "type": "boolean"
    },
    "ownerUserId": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "skillId"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "skill": {
      "type": "object",
      "properties": {
        "skillId": {
          "type": "string"
        },
        "tenant": {
          "type": "string"
        },
        "ownerUserId": {
          "type": [
            "string",
            "null"
          ]
        },
        "accessPolicy": {
          "type": "object",
          "properties": {
            "keys": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "subjectTypes": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "human",
                  "workload"
                ]
              }
            }
          },
          "required": [
            "keys",
            "subjectTypes"
          ],
          "additionalProperties": false
        },
        "enabled": {
          "type": "boolean"
        },
        "invalid": {
          "type": "boolean"
        },
        "createdAt": {
          "type": "string"
        },
        "updatedAt": {
          "type": "string"
        }
      },
      "required": [
        "skillId",
        "tenant",
        "ownerUserId",
        "accessPolicy",
        "enabled",
        "createdAt",
        "updatedAt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "skill"
  ],
  "additionalProperties": false
}

PUT /api/v1/skills

skills.settings.update

کلید مالک را تنظیم کنید: آیا یک مدیر می‌تواند مهارت خود را بدون بازبین دوم منتشر کند. فقط مالک. فقط در نشست انسانی.

نقش
owner
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "allowSelfPublish": {
      "type": "boolean"
    }
  },
  "required": [
    "allowSelfPublish"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "settings": {
      "type": "object",
      "properties": {
        "allowSelfPublish": {
          "type": "boolean"
        }
      },
      "required": [
        "allowSelfPublish"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "settings"
  ],
  "additionalProperties": false
}

PUT /api/v1/skills/{id}

skills.update

تعیین کنید چه کسی یک مهارت را انتخاب می‌کند، روشن است یا نه، یا مالک آن کیست. بدنهٔ جزئی است. فقط در نشست انسانی.

نقش
admin
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "accessPolicy": {
      "type": "object",
      "properties": {
        "keys": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "subjectTypes": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "human",
              "workload"
            ]
          }
        }
      }
    },
    "enabled": {
      "type": "boolean"
    },
    "ownerUserId": {
      "type": [
        "string",
        "null"
      ]
    }
  }
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "skill": {
      "type": "object",
      "properties": {
        "skillId": {
          "type": "string"
        },
        "tenant": {
          "type": "string"
        },
        "ownerUserId": {
          "type": [
            "string",
            "null"
          ]
        },
        "accessPolicy": {
          "type": "object",
          "properties": {
            "keys": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "subjectTypes": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "human",
                  "workload"
                ]
              }
            }
          },
          "required": [
            "keys",
            "subjectTypes"
          ],
          "additionalProperties": false
        },
        "enabled": {
          "type": "boolean"
        },
        "invalid": {
          "type": "boolean"
        },
        "createdAt": {
          "type": "string"
        },
        "updatedAt": {
          "type": "string"
        }
      },
      "required": [
        "skillId",
        "tenant",
        "ownerUserId",
        "accessPolicy",
        "enabled",
        "createdAt",
        "updatedAt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "skill"
  ],
  "additionalProperties": false
}

DELETE /api/v1/skills/{id}

skills.delete

مهارتی را که نسخهٔ منتشرشده یا بازنشسته ندارد حذف کنید. مهارت دارای سابقه را غیرفعال کنید (۴۰۹). فقط در نشست انسانی.

نقش
admin
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    }
  },
  "required": [
    "ok"
  ],
  "additionalProperties": false
}

POST /api/v1/skills/{id}/versions

skills.versions.create

یک نسخهٔ پیش‌نویس از یک مهارت باز کنید، از فیلدها یا از متن نسخهٔ قبلی. بازکننده نویسندهٔ آن است و نمی‌تواند آن را تأیید کند. فقط در نشست انسانی.

نقش
admin
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "fromVersionId": {
      "type": "string"
    },
    "title": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "content": {
      "type": "string"
    },
    "requires": {
      "type": "object",
      "properties": {
        "tools": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "resources": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "prompts": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "compatibility": {
      "type": "object",
      "properties": {
        "clients": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "notes": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    }
  }
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "version": {
      "type": "object",
      "properties": {
        "versionId": {
          "type": "string"
        },
        "skillId": {
          "type": "string"
        },
        "seq": {
          "type": "number"
        },
        "title": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "content": {
          "type": "string"
        },
        "requires": {
          "type": "object",
          "properties": {
            "tools": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "resources": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "prompts": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "required": [
            "tools",
            "resources",
            "prompts"
          ],
          "additionalProperties": false
        },
        "compatibility": {
          "type": "object",
          "properties": {
            "clients": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "notes": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "clients",
            "notes"
          ],
          "additionalProperties": false
        },
        "digest": {
          "type": "string"
        },
        "state": {
          "type": "string",
          "enum": [
            "draft",
            "published",
            "retired"
          ]
        },
        "reviewed": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "primitive": {
                "type": "string",
                "enum": [
                  "tool",
                  "resource",
                  "prompt"
                ]
              },
              "name": {
                "type": "string"
              },
              "readOnly": {
                "type": "boolean"
              },
              "requiredScopes": {
                "anyOf": [
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "custody": {
                "type": "string",
                "enum": [
                  "service",
                  "connection"
                ]
              }
            },
            "required": [
              "primitive",
              "name",
              "readOnly",
              "requiredScopes",
              "custody"
            ],
            "additionalProperties": false
          }
        },
        "publishedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "publishedByEmail": {
          "type": [
            "string",
            "null"
          ]
        },
        "invalid": {
          "type": "boolean"
        },
        "createdByUserId": {
          "type": [
            "string",
            "null"
          ]
        },
        "createdAt": {
          "type": "string"
        },
        "lastEditedByUserId": {
          "type": [
            "string",
            "null"
          ]
        },
        "updatedAt": {
          "type": "string"
        },
        "reviewRequestedByUserId": {
          "type": [
            "string",
            "null"
          ]
        },
        "reviewRequestedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "reviewDigest": {
          "type": [
            "string",
            "null"
          ]
        },
        "screening": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "screenedAt": {
                  "type": "string"
                },
                "action": {
                  "type": "string",
                  "enum": [
                    "allow",
                    "flag",
                    "block"
                  ]
                },
                "screened": {
                  "type": "boolean"
                },
                "routes": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "guards": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "coveredBy": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "unavailable": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "guard": {
                        "type": "string"
                      },
                      "category": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "guard",
                      "category"
                    ],
                    "additionalProperties": false
                  }
                },
                "findings": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "guard": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string"
                      },
                      "category": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ruleId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ruleType": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "routes": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "source": {
                        "type": "string",
                        "enum": [
                          "console",
                          "gateway"
                        ]
                      }
                    },
                    "required": [
                      "guard",
                      "action",
                      "category",
                      "ruleId",
                      "ruleType",
                      "routes",
                      "source"
                    ],
                    "additionalProperties": false
                  }
                },
                "gateway": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "asked": {
                          "type": "boolean",
                          "const": false
                        }
                      },
                      "required": [
                        "asked"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "asked": {
                          "type": "boolean",
                          "const": true
                        },
                        "answered": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "asked",
                        "answered"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "asked": {
                          "type": "boolean",
                          "const": true
                        },
                        "answered": {
                          "type": "boolean",
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "asked",
                        "answered",
                        "error"
                      ],
                      "additionalProperties": false
                    }
                  ]
                }
              },
              "required": [
                "screenedAt",
                "action",
                "screened",
                "routes",
                "guards",
                "coveredBy",
                "unavailable",
                "findings",
                "gateway"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "publishedByUserId": {
          "type": [
            "string",
            "null"
          ]
        },
        "retiredByUserId": {
          "type": [
            "string",
            "null"
          ]
        },
        "retiredAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "reviewerUserId": {
          "type": [
            "string",
            "null"
          ]
        },
        "changesRequestedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "changesRequestedContent": {
          "type": [
            "string",
            "null"
          ]
        },
        "selfReviewed": {
          "type": "boolean"
        },
        "contributorUserIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "versionId",
        "skillId",
        "seq",
        "title",
        "description",
        "content",
        "requires",
        "compatibility",
        "digest",
        "state",
        "reviewed",
        "publishedAt",
        "publishedByEmail",
        "createdByUserId",
        "createdAt",
        "lastEditedByUserId",
        "updatedAt",
        "reviewRequestedByUserId",
        "reviewRequestedAt",
        "reviewDigest",
        "screening",
        "publishedByUserId",
        "retiredByUserId",
        "retiredAt",
        "reviewerUserId",
        "changesRequestedAt",
        "changesRequestedContent",
        "selfReviewed",
        "contributorUserIds"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "version"
  ],
  "additionalProperties": false
}

PUT /api/v1/skills/{id}/versions/{versionId}

skills.versions.update

یک پیش‌نویس را ویرایش کنید، بازبین آن را نام ببرید یا بازبینی را پس بگیرید، با کلید مالک خودتان منتشر کنید (غربالگری می‌شود)، یا نسخهٔ منتشرشده را بازنشسته کنید. فقط در نشست انسانی.

نقش
admin
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "state": {
      "type": "string",
      "enum": [
        "published",
        "retired"
      ]
    },
    "mode": {
      "type": "string"
    },
    "expectedDigest": {
      "type": "string"
    },
    "review": {
      "type": "boolean"
    },
    "reviewerUserId": {
      "type": "string"
    },
    "title": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "content": {
      "type": "string"
    },
    "requires": {
      "type": "object",
      "properties": {
        "tools": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "resources": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "prompts": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "compatibility": {
      "type": "object",
      "properties": {
        "clients": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "notes": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    }
  }
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "version": {
      "type": "object",
      "properties": {
        "versionId": {
          "type": "string"
        },
        "skillId": {
          "type": "string"
        },
        "seq": {
          "type": "number"
        },
        "title": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "content": {
          "type": "string"
        },
        "requires": {
          "type": "object",
          "properties": {
            "tools": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "resources": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "prompts": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "required": [
            "tools",
            "resources",
            "prompts"
          ],
          "additionalProperties": false
        },
        "compatibility": {
          "type": "object",
          "properties": {
            "clients": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "notes": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "clients",
            "notes"
          ],
          "additionalProperties": false
        },
        "digest": {
          "type": "string"
        },
        "state": {
          "type": "string",
          "enum": [
            "draft",
            "published",
            "retired"
          ]
        },
        "reviewed": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "primitive": {
                "type": "string",
                "enum": [
                  "tool",
                  "resource",
                  "prompt"
                ]
              },
              "name": {
                "type": "string"
              },
              "readOnly": {
                "type": "boolean"
              },
              "requiredScopes": {
                "anyOf": [
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "custody": {
                "type": "string",
                "enum": [
                  "service",
                  "connection"
                ]
              }
            },
            "required": [
              "primitive",
              "name",
              "readOnly",
              "requiredScopes",
              "custody"
            ],
            "additionalProperties": false
          }
        },
        "publishedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "publishedByEmail": {
          "type": [
            "string",
            "null"
          ]
        },
        "invalid": {
          "type": "boolean"
        },
        "createdByUserId": {
          "type": [
            "string",
            "null"
          ]
        },
        "createdAt": {
          "type": "string"
        },
        "lastEditedByUserId": {
          "type": [
            "string",
            "null"
          ]
        },
        "updatedAt": {
          "type": "string"
        },
        "reviewRequestedByUserId": {
          "type": [
            "string",
            "null"
          ]
        },
        "reviewRequestedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "reviewDigest": {
          "type": [
            "string",
            "null"
          ]
        },
        "screening": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "screenedAt": {
                  "type": "string"
                },
                "action": {
                  "type": "string",
                  "enum": [
                    "allow",
                    "flag",
                    "block"
                  ]
                },
                "screened": {
                  "type": "boolean"
                },
                "routes": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "guards": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "coveredBy": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "unavailable": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "guard": {
                        "type": "string"
                      },
                      "category": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "guard",
                      "category"
                    ],
                    "additionalProperties": false
                  }
                },
                "findings": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "guard": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string"
                      },
                      "category": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ruleId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ruleType": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "routes": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "source": {
                        "type": "string",
                        "enum": [
                          "console",
                          "gateway"
                        ]
                      }
                    },
                    "required": [
                      "guard",
                      "action",
                      "category",
                      "ruleId",
                      "ruleType",
                      "routes",
                      "source"
                    ],
                    "additionalProperties": false
                  }
                },
                "gateway": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "asked": {
                          "type": "boolean",
                          "const": false
                        }
                      },
                      "required": [
                        "asked"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "asked": {
                          "type": "boolean",
                          "const": true
                        },
                        "answered": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "asked",
                        "answered"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "asked": {
                          "type": "boolean",
                          "const": true
                        },
                        "answered": {
                          "type": "boolean",
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "asked",
                        "answered",
                        "error"
                      ],
                      "additionalProperties": false
                    }
                  ]
                }
              },
              "required": [
                "screenedAt",
                "action",
                "screened",
                "routes",
                "guards",
                "coveredBy",
                "unavailable",
                "findings",
                "gateway"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "publishedByUserId": {
          "type": [
            "string",
            "null"
          ]
        },
        "retiredByUserId": {
          "type": [
            "string",
            "null"
          ]
        },
        "retiredAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "reviewerUserId": {
          "type": [
            "string",
            "null"
          ]
        },
        "changesRequestedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "changesRequestedContent": {
          "type": [
            "string",
            "null"
          ]
        },
        "selfReviewed": {
          "type": "boolean"
        },
        "contributorUserIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "versionId",
        "skillId",
        "seq",
        "title",
        "description",
        "content",
        "requires",
        "compatibility",
        "digest",
        "state",
        "reviewed",
        "publishedAt",
        "publishedByEmail",
        "createdByUserId",
        "createdAt",
        "lastEditedByUserId",
        "updatedAt",
        "reviewRequestedByUserId",
        "reviewRequestedAt",
        "reviewDigest",
        "screening",
        "publishedByUserId",
        "retiredByUserId",
        "retiredAt",
        "reviewerUserId",
        "changesRequestedAt",
        "changesRequestedContent",
        "selfReviewed",
        "contributorUserIds"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "version"
  ],
  "additionalProperties": false
}

DELETE /api/v1/skills/{id}/versions/{versionId}

skills.versions.delete

یک پیش‌نویس و نظرهای آن را حذف کنید. نسخهٔ منتشرشده یا بازنشسته سابقه است و می‌ماند. فقط در نشست انسانی.

نقش
admin
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    }
  },
  "required": [
    "ok"
  ],
  "additionalProperties": false
}

POST /api/v1/skills/{id}/versions/{versionId}/review

skills.versions.review

بازبین نام‌برده یک پیش‌نویس را تأیید (که آن را با غربالگری منتشر می‌کند) یا با نظرها برمی‌گرداند. فقط همان بازبین، هرگز یک نویسنده. فقط در نشست انسانی.

نقش
viewer
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "action": {
      "type": "string",
      "enum": [
        "approve",
        "requestChanges"
      ]
    },
    "expectedDigest": {
      "type": "string"
    },
    "comments": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "line": {
            "type": [
              "number",
              "null"
            ]
          },
          "body": {
            "type": "string"
          }
        },
        "required": [
          "body"
        ]
      }
    }
  },
  "required": [
    "action"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "version": {
      "type": "object",
      "properties": {
        "versionId": {
          "type": "string"
        },
        "skillId": {
          "type": "string"
        },
        "seq": {
          "type": "number"
        },
        "title": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "content": {
          "type": "string"
        },
        "requires": {
          "type": "object",
          "properties": {
            "tools": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "resources": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "prompts": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "required": [
            "tools",
            "resources",
            "prompts"
          ],
          "additionalProperties": false
        },
        "compatibility": {
          "type": "object",
          "properties": {
            "clients": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "notes": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "clients",
            "notes"
          ],
          "additionalProperties": false
        },
        "digest": {
          "type": "string"
        },
        "state": {
          "type": "string",
          "enum": [
            "draft",
            "published",
            "retired"
          ]
        },
        "reviewed": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "primitive": {
                "type": "string",
                "enum": [
                  "tool",
                  "resource",
                  "prompt"
                ]
              },
              "name": {
                "type": "string"
              },
              "readOnly": {
                "type": "boolean"
              },
              "requiredScopes": {
                "anyOf": [
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "custody": {
                "type": "string",
                "enum": [
                  "service",
                  "connection"
                ]
              }
            },
            "required": [
              "primitive",
              "name",
              "readOnly",
              "requiredScopes",
              "custody"
            ],
            "additionalProperties": false
          }
        },
        "publishedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "publishedByEmail": {
          "type": [
            "string",
            "null"
          ]
        },
        "invalid": {
          "type": "boolean"
        },
        "createdByUserId": {
          "type": [
            "string",
            "null"
          ]
        },
        "createdAt": {
          "type": "string"
        },
        "lastEditedByUserId": {
          "type": [
            "string",
            "null"
          ]
        },
        "updatedAt": {
          "type": "string"
        },
        "reviewRequestedByUserId": {
          "type": [
            "string",
            "null"
          ]
        },
        "reviewRequestedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "reviewDigest": {
          "type": [
            "string",
            "null"
          ]
        },
        "screening": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "screenedAt": {
                  "type": "string"
                },
                "action": {
                  "type": "string",
                  "enum": [
                    "allow",
                    "flag",
                    "block"
                  ]
                },
                "screened": {
                  "type": "boolean"
                },
                "routes": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "guards": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "coveredBy": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "unavailable": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "guard": {
                        "type": "string"
                      },
                      "category": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "guard",
                      "category"
                    ],
                    "additionalProperties": false
                  }
                },
                "findings": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "guard": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string"
                      },
                      "category": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ruleId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ruleType": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "routes": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "source": {
                        "type": "string",
                        "enum": [
                          "console",
                          "gateway"
                        ]
                      }
                    },
                    "required": [
                      "guard",
                      "action",
                      "category",
                      "ruleId",
                      "ruleType",
                      "routes",
                      "source"
                    ],
                    "additionalProperties": false
                  }
                },
                "gateway": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "asked": {
                          "type": "boolean",
                          "const": false
                        }
                      },
                      "required": [
                        "asked"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "asked": {
                          "type": "boolean",
                          "const": true
                        },
                        "answered": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "asked",
                        "answered"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "asked": {
                          "type": "boolean",
                          "const": true
                        },
                        "answered": {
                          "type": "boolean",
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "asked",
                        "answered",
                        "error"
                      ],
                      "additionalProperties": false
                    }
                  ]
                }
              },
              "required": [
                "screenedAt",
                "action",
                "screened",
                "routes",
                "guards",
                "coveredBy",
                "unavailable",
                "findings",
                "gateway"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "publishedByUserId": {
          "type": [
            "string",
            "null"
          ]
        },
        "retiredByUserId": {
          "type": [
            "string",
            "null"
          ]
        },
        "retiredAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "reviewerUserId": {
          "type": [
            "string",
            "null"
          ]
        },
        "changesRequestedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "changesRequestedContent": {
          "type": [
            "string",
            "null"
          ]
        },
        "selfReviewed": {
          "type": "boolean"
        },
        "contributorUserIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "versionId",
        "skillId",
        "seq",
        "title",
        "description",
        "content",
        "requires",
        "compatibility",
        "digest",
        "state",
        "reviewed",
        "publishedAt",
        "publishedByEmail",
        "createdByUserId",
        "createdAt",
        "lastEditedByUserId",
        "updatedAt",
        "reviewRequestedByUserId",
        "reviewRequestedAt",
        "reviewDigest",
        "screening",
        "publishedByUserId",
        "retiredByUserId",
        "retiredAt",
        "reviewerUserId",
        "changesRequestedAt",
        "changesRequestedContent",
        "selfReviewed",
        "contributorUserIds"
      ],
      "additionalProperties": false
    },
    "comments": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "commentId": {
            "type": "string"
          },
          "versionId": {
            "type": "string"
          },
          "digest": {
            "type": "string"
          },
          "line": {
            "type": [
              "number",
              "null"
            ]
          },
          "quote": {
            "type": [
              "string",
              "null"
            ]
          },
          "body": {
            "type": "string"
          },
          "authorUserId": {
            "type": [
              "string",
              "null"
            ]
          },
          "authorEmail": {
            "type": [
              "string",
              "null"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "open",
              "resolved"
            ]
          },
          "reply": {
            "type": [
              "string",
              "null"
            ]
          },
          "resolvedByUserId": {
            "type": [
              "string",
              "null"
            ]
          },
          "resolvedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string"
          }
        },
        "required": [
          "commentId",
          "versionId",
          "digest",
          "line",
          "quote",
          "body",
          "authorUserId",
          "authorEmail",
          "state",
          "reply",
          "resolvedByUserId",
          "resolvedAt",
          "createdAt"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "version"
  ],
  "additionalProperties": false
}

PUT /api/v1/skills/{id}/versions/{versionId}/comments/{commentId}

skills.comments.resolve

یک نظر بازبینی روی پیش‌نویس را با پاسخ اختیاری حل کنید. فقط نویسندگان پیش‌نویس یا نویسندهٔ نظر. حل‌کردن هرگز تأیید نیست. فقط در نشست انسانی.

نقش
viewer
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "reply": {
      "type": [
        "string",
        "null"
      ]
    }
  }
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "comment": {
      "type": "object",
      "properties": {
        "commentId": {
          "type": "string"
        },
        "versionId": {
          "type": "string"
        },
        "digest": {
          "type": "string"
        },
        "line": {
          "type": [
            "number",
            "null"
          ]
        },
        "quote": {
          "type": [
            "string",
            "null"
          ]
        },
        "body": {
          "type": "string"
        },
        "authorUserId": {
          "type": [
            "string",
            "null"
          ]
        },
        "authorEmail": {
          "type": [
            "string",
            "null"
          ]
        },
        "state": {
          "type": "string",
          "enum": [
            "open",
            "resolved"
          ]
        },
        "reply": {
          "type": [
            "string",
            "null"
          ]
        },
        "resolvedByUserId": {
          "type": [
            "string",
            "null"
          ]
        },
        "resolvedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "createdAt": {
          "type": "string"
        }
      },
      "required": [
        "commentId",
        "versionId",
        "digest",
        "line",
        "quote",
        "body",
        "authorUserId",
        "authorEmail",
        "state",
        "reply",
        "resolvedByUserId",
        "resolvedAt",
        "createdAt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "comment"
  ],
  "additionalProperties": false
}

GET /api/v1/alerts/channels

alerts.channels.list

کانال‌های هشدار بودجه را فهرست کنید. نشانی وب‌هوک پوشانده می‌شود؛ این نشانی یک رمز است.

نقش
owner
دامنه
alerts:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "channels": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "webhook",
              "email"
            ]
          },
          "target": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "minLevel": {
            "type": "number"
          },
          "createdAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "type",
          "target",
          "enabled",
          "minLevel",
          "createdAt"
        ],
        "additionalProperties": false
      }
    },
    "emailConfigured": {
      "type": "boolean"
    }
  },
  "required": [
    "channels",
    "emailConfigured"
  ],
  "additionalProperties": false
}

POST /api/v1/alerts/channels

alerts.channels.create

یک کانال هشدار بودجه اضافه کنید: یک وب‌هوک یا گیرندگان ایمیل، در آستانهٔ ۸۰٪ یا ۱۰۰٪. فقط در نشست انسانی.

نقش
owner
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "webhook",
        "email"
      ]
    },
    "target": {
      "type": "string",
      "minLength": 1
    },
    "minLevel": {
      "default": 80,
      "anyOf": [
        {
          "type": "number",
          "const": 80
        },
        {
          "type": "number",
          "const": 100
        }
      ]
    },
    "enabled": {
      "default": true,
      "type": "boolean"
    }
  },
  "required": [
    "type",
    "target"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "channel": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "enum": [
            "webhook",
            "email"
          ]
        },
        "target": {
          "type": "string"
        },
        "enabled": {
          "type": "boolean"
        },
        "minLevel": {
          "type": "number"
        },
        "createdAt": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "type",
        "target",
        "enabled",
        "minLevel",
        "createdAt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "channel"
  ],
  "additionalProperties": false
}

PATCH /api/v1/alerts/channels/{id}

alerts.channels.update

یک کانال هشدار را روشن یا خاموش کنید، آستانه یا مقصد آن را تغییر دهید. کانال ناشناخته خطای ۴۰۴ می‌دهد. فقط در نشست انسانی.

نقش
owner
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "enabled": {
      "type": "boolean"
    },
    "minLevel": {
      "anyOf": [
        {
          "type": "number",
          "const": 80
        },
        {
          "type": "number",
          "const": 100
        }
      ]
    },
    "target": {
      "type": "string",
      "minLength": 1
    }
  }
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "channel": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "enum": [
            "webhook",
            "email"
          ]
        },
        "target": {
          "type": "string"
        },
        "enabled": {
          "type": "boolean"
        },
        "minLevel": {
          "type": "number"
        },
        "createdAt": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "type",
        "target",
        "enabled",
        "minLevel",
        "createdAt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "channel"
  ],
  "additionalProperties": false
}

DELETE /api/v1/alerts/channels/{id}

alerts.channels.delete

یک کانال هشدار را حذف کنید. حذف کانالی که وجود ندارد موفق است. فقط در نشست انسانی.

نقش
owner
تکرار بی‌خطر
✓
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    }
  },
  "required": [
    "ok"
  ],
  "additionalProperties": false
}

POST /api/v1/alerts/check

alerts.check

همهٔ بودجه‌ها را اکنون با آستانه‌های هشدار مقایسه کنید و هر عبور تازه را یک بار تحویل دهید. تکرار آن بی‌خطر است.

نقش
admin
دامنه
alerts:write
تکرار بی‌خطر
✓
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "channels": {
      "type": "number"
    },
    "subjects": {
      "type": "number"
    },
    "fired": {
      "type": "number"
    },
    "deliveries": {
      "type": "number"
    },
    "failures": {
      "type": "number"
    }
  },
  "required": [
    "channels",
    "subjects",
    "fired",
    "deliveries",
    "failures"
  ],
  "additionalProperties": false
}

GET /api/v1/reports/{id}

reports.read

تعریف یک گزارش را بخوانید: شناسهٔ یک گزارش داخلی، یا uuid گزارش ذخیره‌شده‌ای که فراخوان می‌تواند ببیند. پرسش، هرگز ارقام.

نقش
viewer
دامنه
usage:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "report": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "built_in",
            "saved"
          ]
        },
        "id": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "spec": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string",
              "enum": [
                "requests",
                "tool_calls",
                "agent_metrics",
                "outcomes"
              ]
            },
            "dimensions": {
              "maxItems": 2,
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "client",
                  "model",
                  "route",
                  "subject",
                  "key",
                  "channel",
                  "tag",
                  "session",
                  "server",
                  "tool",
                  "repository",
                  "day",
                  "week",
                  "month"
                ]
              }
            },
            "measures": {
              "minItems": 1,
              "maxItems": 40,
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "requests",
                  "input_tokens",
                  "output_tokens",
                  "total_tokens",
                  "cached_tokens",
                  "cost_usd",
                  "unpriced_requests",
                  "users",
                  "sessions",
                  "active_hours",
                  "latency_avg_ms",
                  "latency_p95_ms",
                  "ttft_avg_ms",
                  "cost_share",
                  "request_share",
                  "cost_per_user",
                  "requests_per_user",
                  "cost_per_1k_requests",
                  "tokens_per_request",
                  "cost_per_1m_tokens",
                  "cost_per_1k_sessions",
                  "cost_per_active_hour",
                  "cache_hit_rate",
                  "cost_decomposition",
                  "calls",
                  "ok",
                  "failed",
                  "unknown",
                  "denied",
                  "pending",
                  "unpriced_calls",
                  "cost_per_ok_call",
                  "operations",
                  "estimated_cost_usd",
                  "merged_prs",
                  "reverted_prs",
                  "revert_rate",
                  "reviews",
                  "joined_prs",
                  "cost_per_merged_pr"
                ]
              }
            },
            "filters": {
              "type": "object",
              "propertyNames": {
                "type": "string",
                "enum": [
                  "client",
                  "model",
                  "route",
                  "subject",
                  "key",
                  "channel",
                  "tag",
                  "session",
                  "server",
                  "tool",
                  "repository",
                  "day",
                  "week",
                  "month"
                ]
              },
              "additionalProperties": {
                "maxItems": 50,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200
                }
              }
            },
            "range": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "7d",
                    "30d",
                    "mtd",
                    "last_month"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "from": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "to": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "from",
                    "to"
                  ],
                  "additionalProperties": false
                }
              ]
            },
            "compare": {
              "type": "string",
              "enum": [
                "none",
                "previous_period"
              ]
            },
            "view": {
              "type": "string",
              "enum": [
                "table",
                "bar",
                "line",
                "stacked",
                "waterfall"
              ]
            }
          },
          "required": [
            "source",
            "dimensions",
            "measures",
            "filters",
            "range",
            "compare",
            "view"
          ],
          "additionalProperties": false
        },
        "ownerEmail": {
          "type": [
            "string",
            "null"
          ]
        },
        "visibility": {
          "type": "string",
          "enum": [
            "private",
            "role:viewer",
            "role:admin",
            "role:owner"
          ]
        },
        "pinned": {
          "type": "boolean"
        },
        "editable": {
          "type": "boolean"
        },
        "updatedAt": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "kind",
        "id",
        "title",
        "description",
        "spec",
        "ownerEmail",
        "visibility",
        "pinned",
        "editable",
        "updatedAt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "report"
  ],
  "additionalProperties": false
}

DELETE /api/v1/reports/{id}

reports.delete

گزارش ذخیره‌شده‌ای را که مال فراخوان است حذف کنید. گزارش شخص دیگر، یا گزارش ناموجود، خطای ۴۰۴ می‌دهد. فقط در نشست انسانی.

نقش
viewer
دامنه
reports:write
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    }
  },
  "required": [
    "ok"
  ],
  "additionalProperties": false
}

GET /api/v1/config/routes/{name}/utterances

config.utterances.read

نمونه‌های طبقه‌بند یک مسیر را بخوانید. مسیر ناشناخته خطای ۴۰۴ می‌دهد.

نقش
viewer
دامنه
config:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "utterances": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "utterances"
  ],
  "additionalProperties": false
}

PUT /api/v1/config/routes/{name}/utterances

config.utterances.set

نمونه‌های طبقه‌بند یک مسیر را جایگزین کنید. درگاه نمایهٔ بردارهای خود را دوباره می‌سازد. مسیر ناشناخته خطای ۴۰۴ می‌دهد.

نقش
admin
دامنه
config:write
نیاز به If-Match
✓
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "utterances": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "utterances"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    },
    "utterances": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "ok",
    "utterances"
  ],
  "additionalProperties": false
}

POST /api/v1/capture/plaintext/purge

capture.plaintext.purge

بدنه‌های ضبط‌شدهٔ پیش از رمزنگاری را حذف کنید. فرادادهٔ درخواست‌ها می‌ماند. برگشت‌ناپذیر است؛ `dryRun` فقط می‌شمارد. فقط در نشست انسانی.

نقش
owner
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "dryRun": {
      "default": false,
      "type": "boolean"
    }
  }
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "dryRun": {
      "type": "boolean"
    },
    "rows": {
      "type": "number"
    },
    "deleted": {
      "type": "number"
    },
    "remaining": {
      "type": "number"
    }
  },
  "required": [
    "dryRun",
    "rows",
    "deleted",
    "remaining"
  ],
  "additionalProperties": false
}

GET /api/v1/guardrails

guardrails.read

قواعد غربالگری را بخوانید: کلید اصلی، هر قاعده با دامنه و حالت آن، پاسخ نرم و غربالگری جریان.

نقش
viewer
دامنه
guardrails:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "guardrails": {
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean"
        },
        "rules": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "type": {
                "type": "string"
              },
              "stages": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "request",
                    "response",
                    "tool_call",
                    "tool_result"
                  ]
                }
              },
              "mode": {
                "type": "string",
                "enum": [
                  "off",
                  "flag",
                  "block",
                  "escalate"
                ]
              },
              "routes": {
                "anyOf": [
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "keys": {
                "anyOf": [
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "tags": {
                "anyOf": [
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "tools": {
                "anyOf": [
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "routeModes": {
                "anyOf": [
                  {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "string",
                      "enum": [
                        "off",
                        "flag",
                        "block",
                        "escalate"
                      ]
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "keyModes": {
                "anyOf": [
                  {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "string",
                      "enum": [
                        "off",
                        "flag",
                        "block",
                        "escalate"
                      ]
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "after": {
                "anyOf": [
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "patterns": {
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "pattern": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "name",
                        "pattern"
                      ],
                      "additionalProperties": false
                    }
                  ]
                }
              },
              "entropy": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "enabled": {
                        "type": "boolean"
                      },
                      "threshold": {
                        "type": "number"
                      },
                      "minLength": {
                        "type": "number"
                      }
                    },
                    "required": [
                      "enabled",
                      "threshold",
                      "minLength"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "normalizePersian": {
                "type": "boolean"
              },
              "model": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "categories": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "failClosed": {
                "type": "boolean"
              },
              "threshold": {
                "type": [
                  "number",
                  "null"
                ]
              }
            },
            "required": [
              "id",
              "name",
              "type",
              "stages",
              "mode"
            ],
            "additionalProperties": false
          }
        },
        "softDeny": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "routes": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "keys": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "routes",
                "keys",
                "message"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "streamScreening": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "routes": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "keys": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "maxBytes": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "maxMs": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "onExceeded": {
                  "type": "string",
                  "enum": [
                    "open",
                    "closed"
                  ]
                }
              },
              "required": [
                "routes",
                "keys",
                "maxBytes",
                "maxMs",
                "onExceeded"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "enabled",
        "rules"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "guardrails"
  ],
  "additionalProperties": false
}

PUT /api/v1/guardrails

guardrails.update

قواعد غربالگری را جایگزین کنید. درگاه آن‌ها را بی‌درنگ بارگذاری می‌کند. قاعده‌ای که نمی‌تواند اجرا شود رد می‌شود، هرگز بریده نمی‌شود. فقط در نشست انسانی.

نقش
admin
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "enabled": {
      "type": "boolean"
    },
    "rules": {
      "type": "array",
      "items": {
        "type": "object",
        "propertyNames": {
          "type": "string"
        },
        "additionalProperties": {}
      }
    },
    "softDeny": {
      "anyOf": [
        {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {}
        },
        {
          "type": "null"
        }
      ]
    },
    "streamScreening": {
      "anyOf": [
        {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {}
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "enabled",
    "rules"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    }
  },
  "required": [
    "ok"
  ],
  "additionalProperties": false
}

GET /api/v1/guardrails/activity

guardrails.activity

تعداد درخواست‌هایی را که هر قاعده بر آن‌ها عمل کرده، به تفکیک مرحله و اقدام، در یک بازه بشمارید (پیش‌فرض: ۳۰ روز).

نقش
viewer
دامنه
guardrails:activity:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "rows": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "ruleId": {
            "type": [
              "string",
              "null"
            ]
          },
          "guard": {
            "type": "string"
          },
          "ruleType": {
            "type": [
              "string",
              "null"
            ]
          },
          "stage": {
            "type": "string"
          },
          "action": {
            "type": "string"
          },
          "requests": {
            "type": "number"
          },
          "lastSeen": {
            "type": "string"
          }
        },
        "required": [
          "ruleId",
          "guard",
          "ruleType",
          "stage",
          "action",
          "requests",
          "lastSeen"
        ],
        "additionalProperties": false
      }
    },
    "days": {
      "type": "number"
    }
  },
  "required": [
    "rows",
    "days"
  ],
  "additionalProperties": false
}

POST /api/v1/guardrails/test

guardrails.test

یک نمونه را برای یک مسیر، کلید و برچسب‌ها با قواعد غربال کنید، بی آنکه چیزی ذخیره شود. بودجه برای هر فراخوان محدود است (۴۲۹)؛ هر آزمون بدون متن آن ثبت می‌شود.

نقش
admin
دامنه
guardrails:test
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "text": {
      "type": "string"
    },
    "stage": {
      "default": "request",
      "type": "string",
      "enum": [
        "request",
        "response"
      ]
    },
    "route": {
      "type": "string",
      "minLength": 1
    },
    "key": {
      "default": "",
      "type": "string"
    },
    "tags": {
      "default": [],
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "text",
    "route"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "action": {
      "type": "string"
    },
    "stage": {
      "type": "string",
      "enum": [
        "request",
        "response"
      ]
    },
    "route": {
      "type": "string"
    },
    "key": {
      "type": "string"
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "screensRemaining": {
      "type": "number"
    },
    "guards": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "coveredBy": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "unavailable": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "guard": {
            "type": "string"
          },
          "category": {
            "type": "string"
          }
        },
        "required": [
          "guard",
          "category"
        ],
        "additionalProperties": false
      }
    },
    "findings": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "guard": {
            "type": "string"
          },
          "action": {
            "type": "string"
          },
          "category": {
            "type": [
              "string",
              "null"
            ]
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "guard",
          "action",
          "category",
          "reason"
        ],
        "additionalProperties": false
      }
    },
    "remote": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "guard": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        },
        "required": [
          "guard",
          "type"
        ],
        "additionalProperties": false
      }
    },
    "gateway": {
      "anyOf": [
        {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "action": {
                  "type": "string"
                },
                "screened": {
                  "type": "boolean"
                },
                "guards": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "coveredBy": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "unavailable": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "guard": {
                        "type": "string"
                      },
                      "category": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "guard",
                      "category"
                    ],
                    "additionalProperties": false
                  }
                },
                "findings": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "guard": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string"
                      },
                      "category": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "reason": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "guard",
                      "action",
                      "category",
                      "reason"
                    ],
                    "additionalProperties": false
                  }
                },
                "keyId": {
                  "type": "string"
                },
                "tags": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "keyMismatch": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "guard": {
                        "type": "string"
                      },
                      "previewed": {
                        "type": "string",
                        "enum": [
                          "off",
                          "flag",
                          "block",
                          "escalate"
                        ]
                      },
                      "actual": {
                        "type": "string",
                        "enum": [
                          "off",
                          "flag",
                          "block",
                          "escalate"
                        ]
                      }
                    },
                    "required": [
                      "guard",
                      "previewed",
                      "actual"
                    ],
                    "additionalProperties": false
                  }
                }
              },
              "required": [
                "action",
                "screened",
                "guards",
                "coveredBy",
                "unavailable",
                "findings",
                "keyId",
                "tags",
                "keyMismatch"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "error": {
                  "type": "string"
                }
              },
              "required": [
                "error"
              ],
              "additionalProperties": false
            }
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "softDeny": {
      "type": "boolean"
    }
  },
  "required": [
    "action",
    "stage",
    "route",
    "key",
    "tags",
    "screensRemaining",
    "guards",
    "coveredBy",
    "unavailable",
    "findings",
    "remote",
    "gateway",
    "softDeny"
  ],
  "additionalProperties": false
}

GET /api/v1/retention

retention.read

سیاست نگه‌داری (روزهای نگه‌داری برای هر جدول؛ ۰ یعنی برای همیشه) و آخرین اجرای پاک‌سازی را بخوانید.

نقش
viewer
دامنه
retention:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "retention": {
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean"
        },
        "manualEnabled": {
          "type": "boolean"
        },
        "schedule": {
          "type": "object",
          "properties": {
            "enabled": {
              "type": "boolean"
            },
            "intervalMinutes": {
              "type": "number"
            },
            "pausedUntil": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "enabled",
            "intervalMinutes",
            "pausedUntil"
          ],
          "additionalProperties": false
        },
        "rules": {
          "type": "object",
          "properties": {
            "request_payloads": {
              "type": "object",
              "properties": {
                "enabled": {
                  "type": "boolean"
                },
                "days": {
                  "type": "number"
                }
              },
              "required": [
                "enabled",
                "days"
              ],
              "additionalProperties": false
            },
            "request_logs": {
              "type": "object",
              "properties": {
                "enabled": {
                  "type": "boolean"
                },
                "days": {
                  "type": "number"
                }
              },
              "required": [
                "enabled",
                "days"
              ],
              "additionalProperties": false
            },
            "otel_metric_points": {
              "type": "object",
              "properties": {
                "enabled": {
                  "type": "boolean"
                },
                "days": {
                  "type": "number"
                }
              },
              "required": [
                "enabled",
                "days"
              ],
              "additionalProperties": false
            },
            "hook_events": {
              "type": "object",
              "properties": {
                "enabled": {
                  "type": "boolean"
                },
                "days": {
                  "type": "number"
                }
              },
              "required": [
                "enabled",
                "days"
              ],
              "additionalProperties": false
            },
            "tool_calls": {
              "type": "object",
              "properties": {
                "enabled": {
                  "type": "boolean"
                },
                "days": {
                  "type": "number"
                }
              },
              "required": [
                "enabled",
                "days"
              ],
              "additionalProperties": false
            },
            "idempotency_keys": {
              "type": "object",
              "properties": {
                "enabled": {
                  "type": "boolean"
                },
                "days": {
                  "type": "number"
                }
              },
              "required": [
                "enabled",
                "days"
              ],
              "additionalProperties": false
            },
            "rate_limit_buckets": {
              "type": "object",
              "properties": {
                "enabled": {
                  "type": "boolean"
                },
                "days": {
                  "type": "number"
                }
              },
              "required": [
                "enabled",
                "days"
              ],
              "additionalProperties": false
            },
            "copilot_actions": {
              "type": "object",
              "properties": {
                "enabled": {
                  "type": "boolean"
                },
                "days": {
                  "type": "number"
                }
              },
              "required": [
                "enabled",
                "days"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "request_payloads",
            "request_logs",
            "otel_metric_points",
            "hook_events",
            "tool_calls",
            "idempotency_keys",
            "rate_limit_buckets",
            "copilot_actions"
          ],
          "additionalProperties": false
        },
        "batchSize": {
          "type": "number"
        }
      },
      "required": [
        "enabled",
        "manualEnabled",
        "schedule",
        "rules",
        "batchSize"
      ],
      "additionalProperties": false
    },
    "lastRun": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "job": {
              "type": "string"
            },
            "leaseUntil": {
              "type": [
                "string",
                "null"
              ]
            },
            "lastStartedAt": {
              "type": [
                "string",
                "null"
              ]
            },
            "lastFinishedAt": {
              "type": [
                "string",
                "null"
              ]
            },
            "lastStatus": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "ok",
                    "partial",
                    "failed"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            },
            "lastDetail": {
              "type": [
                "string",
                "null"
              ]
            },
            "lastCounts": {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {
                "type": "number"
              }
            }
          },
          "required": [
            "job",
            "leaseUntil",
            "lastStartedAt",
            "lastFinishedAt",
            "lastStatus",
            "lastDetail",
            "lastCounts"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "retention",
    "lastRun"
  ],
  "additionalProperties": false
}

PUT /api/v1/retention

retention.update

سیاست نگه‌داری را جایگزین کنید. فقط مالک؛ پیش و پس از تغییر ثبت می‌شود. فقط در نشست انسانی.

نقش
owner
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "enabled": {
      "type": "boolean"
    },
    "manualEnabled": {
      "type": "boolean"
    },
    "schedule": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {}
    },
    "rules": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {}
    },
    "batchSize": {
      "type": "number"
    }
  },
  "required": [
    "enabled",
    "manualEnabled",
    "schedule",
    "rules"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    }
  },
  "required": [
    "ok"
  ],
  "additionalProperties": false
}

POST /api/v1/retention/run

retention.run

اکنون یک دور پاک‌سازی با سیاست فعلی اجرا کنید، یا آن را بشمارید (`dryRun`). برگشت‌ناپذیر است. وقتی سیاست اجرای دستی را می‌بندد خطای ۴۰۹ می‌دهد. فقط در نشست انسانی.

نقش
admin
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "dryRun": {
      "default": false,
      "type": "boolean"
    }
  }
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "dryRun": {
      "type": "boolean"
    },
    "blocked": {
      "type": [
        "string",
        "null"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "ok",
        "partial",
        "failed"
      ]
    },
    "targets": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "target": {
            "type": "string"
          },
          "rows": {
            "type": "number"
          },
          "skipped": {
            "type": [
              "string",
              "null"
            ]
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "truncated": {
            "type": "boolean"
          }
        },
        "required": [
          "target",
          "rows",
          "skipped",
          "error",
          "truncated"
        ],
        "additionalProperties": false
      }
    },
    "rows": {
      "type": "number"
    }
  },
  "required": [
    "dryRun",
    "blocked",
    "status",
    "targets",
    "rows"
  ],
  "additionalProperties": false
}

GET /api/v1/subscription-lane

subscription-lane.read

بخوانید که آیا یک اعتبار اشتراک claude.ai می‌تواند از درگاه عبور کند، و هر حالت چه می‌کند.

نقش
viewer
دامنه
subscription_lane:read
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "subscriptionLane": {
      "type": "object",
      "properties": {
        "mode": {
          "type": "string",
          "enum": [
            "off",
            "allow",
            "require_key"
          ]
        }
      },
      "required": [
        "mode"
      ],
      "additionalProperties": false
    },
    "reason": {
      "type": "string"
    },
    "modes": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "off",
              "allow",
              "require_key"
            ]
          },
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "mode",
          "reason"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "subscriptionLane",
    "reason",
    "modes"
  ],
  "additionalProperties": false
}

PUT /api/v1/subscription-lane

subscription-lane.update

مسیر اشتراک را تنظیم کنید: off، allow یا require_key. فقط مالک؛ درگاه آن را در بارگذاری بعدی پیکربندی اعمال می‌کند. فقط در نشست انسانی.

نقش
owner
بدنهٔ درخواست
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "mode": {
      "type": "string",
      "enum": [
        "off",
        "allow",
        "require_key"
      ]
    }
  },
  "required": [
    "mode"
  ]
}
پاسخ
json schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    },
    "subscriptionLane": {
      "type": "object",
      "properties": {
        "mode": {
          "type": "string",
          "enum": [
            "off",
            "allow",
            "require_key"
          ]
        }
      },
      "required": [
        "mode"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "ok",
    "subscriptionLane"
  ],
  "additionalProperties": false
}