curl --request GET \
--url https://api.novita.ai/openapi/v2/user/key/<stringId>/model-access-policy \
--header 'Authorization: Bearer <API_KEY>'
{
"stringId": "key_xxx",
"policy": {
"schemaVersion": 1,
"productScope": "model_api",
"mode": "selected",
"allowedModels": [
{
"type": "llm",
"id": "deepseek/deepseek-v3"
}
],
"excludedModels": [],
"source": {
"type": "private_policy"
}
},
"policyStatus": "active",
"allowedModelCount": 1,
"excludedModelCount": 0,
"updatedAt": 1783764000,
"updatedBy": "user_uuid_xxx"
}
{
"stringId": "key_xxx",
"policy": {
"schemaVersion": 1,
"productScope": "model_api",
"mode": "all_enabled",
"allowedModels": [],
"excludedModels": [],
"source": {
"type": "default"
}
},
"policyStatus": "active",
"allowedModelCount": 0,
"excludedModelCount": 0,
"updatedAt": 0,
"updatedBy": ""
}
API Key Model Access
Get API Key Model Access Policy
GET
/
openapi
/
v2
/
user
/
key
/
{stringId}
/
model-access-policy
curl --request GET \
--url https://api.novita.ai/openapi/v2/user/key/<stringId>/model-access-policy \
--header 'Authorization: Bearer <API_KEY>'
{
"stringId": "key_xxx",
"policy": {
"schemaVersion": 1,
"productScope": "model_api",
"mode": "selected",
"allowedModels": [
{
"type": "llm",
"id": "deepseek/deepseek-v3"
}
],
"excludedModels": [],
"source": {
"type": "private_policy"
}
},
"policyStatus": "active",
"allowedModelCount": 1,
"excludedModelCount": 0,
"updatedAt": 1783764000,
"updatedBy": "user_uuid_xxx"
}
{
"stringId": "key_xxx",
"policy": {
"schemaVersion": 1,
"productScope": "model_api",
"mode": "all_enabled",
"allowedModels": [],
"excludedModels": [],
"source": {
"type": "default"
}
},
"policyStatus": "active",
"allowedModelCount": 0,
"excludedModelCount": 0,
"updatedAt": 0,
"updatedBy": ""
}
Retrieve the current model access policy of a single API key. If the key has never been configured, the default policy (
The target API key must belong to the caller’s team.
mode=all_enabled) is returned.
allowedModels / excludedModels may be returned as null or an empty array; callers should treat both as an empty array.Permissions
| Role | Access |
|---|---|
| Owner / Admin | Can query the full policy of any API key in the team. |
| Developer | Can query only keys they own, and the response omits the allowedModels / excludedModels details. |
Request Headers
string
requis
Bearer authentication format, for example: Bearer {{API Key}}.
Path Parameters
string
requis
The stringId of the target API key.
Response Parameters
string
requis
The stringId of the API key.
object
requis
The model access policy object.
Masquer properties
Masquer properties
int32
requis
Policy schema version. Currently
1.string
requis
Product scope the policy applies to. Currently only
model_api.string
requis
Access mode. Possible values:
all_enabled (can access all enabled models), selected (can access only the specified models).object[]
object[]
Excluded models. Meaningful only when
mode=all_enabled; empty when mode=selected. Same structure as allowedModels. Not returned in detail for Developer queries.string
requis
Policy status.
active means the policy is effective; no_available_models means no accessible model remains (for example, all selected models are offline).int32
requis
Number of accessible models.
int32
requis
Number of excluded models.
int64
requis
Last update time, as a Unix timestamp in seconds.
0 for the default policy.string
requis
Identifier of the user who last updated the policy. Empty string for the default policy.
curl --request GET \
--url https://api.novita.ai/openapi/v2/user/key/<stringId>/model-access-policy \
--header 'Authorization: Bearer <API_KEY>'
{
"stringId": "key_xxx",
"policy": {
"schemaVersion": 1,
"productScope": "model_api",
"mode": "selected",
"allowedModels": [
{
"type": "llm",
"id": "deepseek/deepseek-v3"
}
],
"excludedModels": [],
"source": {
"type": "private_policy"
}
},
"policyStatus": "active",
"allowedModelCount": 1,
"excludedModelCount": 0,
"updatedAt": 1783764000,
"updatedBy": "user_uuid_xxx"
}
{
"stringId": "key_xxx",
"policy": {
"schemaVersion": 1,
"productScope": "model_api",
"mode": "all_enabled",
"allowedModels": [],
"excludedModels": [],
"source": {
"type": "default"
}
},
"policyStatus": "active",
"allowedModelCount": 0,
"excludedModelCount": 0,
"updatedAt": 0,
"updatedBy": ""
}
Dernière modification le 10 août 2026