管理员

GET /core/v1/admin/channels

渠道分页与当前文字/图片/视频型号组合筛选

身份要求

管理员. 会话/管理写操作不在公共 Playground 执行。

接口

curl --request GET 'https://api.oneaster.ai/core/v1/admin/channels' \
  --header 'Authorization: Bearer '"$ONEASTER_SESSION_TOKEN"

参数

- page (query, 可选): {"type":"integer","minimum":1,"maximum":1000000,"default":1}

- size (query, 可选): {"type":"integer","minimum":1,"maximum":100,"default":20}

- search (query, 可选): {"type":"string"}

- model (query, 可选): {"type":"string"} 精确匹配当前文字映射或图片/视频任务配置的公开及有效上游型号;包含停用型号,不匹配历史改绑。与其他条件取交集,同一渠道只计一次。

- type (query, 可选): {"type":"string"}

- group (query, 可选): {"type":"string"}

- tag (query, 可选): {"type":"string"}

- status (query, 可选): {"type":"string"}

- sort (query, 可选): {"type":"string"}

- direction (query, 可选): {"type":"string"}

响应

200

渠道分页与当前文字/图片/视频型号组合筛选

{
  "application/json": {
    "schema": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "success": {
          "const": true
        },
        "data": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "items": {
              "type": "array",
              "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[0-9]+$"
                  },
                  "config": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string"
                      },
                      "base_url": {
                        "type": "string"
                      },
                      "models": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "additionalProperties": false,
                          "properties": {
                            "model": {
                              "type": "string"
                            },
                            "upstream_model": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "model",
                            "upstream_model"
                          ]
                        }
                      },
                      "groups": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "priority": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "weight": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "tag": {
                        "type": "string"
                      },
                      "notes": {
                        "type": "string"
                      },
                      "auto_disable": {
                        "type": "boolean"
                      },
                      "options": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "string"
                        }
                      },
                      "headers": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "string"
                        }
                      },
                      "parameters": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "number"
                        }
                      }
                    },
                    "required": [
                      "name",
                      "type",
                      "base_url",
                      "models",
                      "groups",
                      "priority",
                      "weight",
                      "tag",
                      "notes",
                      "auto_disable",
                      "options",
                      "headers",
                      "parameters"
                    ]
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "version": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "credential_version": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "archived_at": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date-time"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "created_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "used_micro": {
                    "type": "string",
                    "pattern": "^[0-9]+$",
                    "description": "整数账务单位;1 积分 = 10000 单位,1 USD = 100 积分。前端用 BigInt。"
                  },
                  "last_check": {
                    "anyOf": [
                      {
                        "type": "object"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "id",
                  "config",
                  "enabled",
                  "version",
                  "credential_version",
                  "archived_at",
                  "created_at",
                  "used_micro",
                  "last_check"
                ]
              }
            },
            "total": {
              "type": "string",
              "pattern": "^[0-9]+$"
            },
            "page": {
              "type": "integer",
              "minimum": 0
            },
            "size": {
              "type": "integer",
              "minimum": 0
            }
          },
          "required": [
            "items",
            "total",
            "page",
            "size"
          ]
        }
      },
      "required": [
        "success",
        "data"
      ]
    }
  }
}

default

错误代码见 core-api.md;供应商/数据库错误已隐藏。

{
  "application/json": {
    "schema": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "success": {
          "const": false
        },
        "error": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "type": {
              "const": "oneaster_error"
            }
          },
          "required": [
            "code",
            "message",
            "type"
          ]
        },
        "data": {
          "type": "null"
        }
      },
      "required": [
        "success",
        "error",
        "data"
      ]
    }
  }
}