🎉 Portkey raises Series A - $15M to build AI that never breaks  Read announcement →
from portkey_ai import Portkey
# Initialize the Portkey client
portkey = Portkey(
api_key="PORTKEY_API_KEY",
)
# Create a new API key
api_key = portkey.api_keys.create(
name="API_KEY_NAME_0909",
type="organisation",
sub_type="service",
workspace_id="WORKSPACE_ID",
scopes=[
"logs.export",
"logs.list",
"logs.view",
"configs.create",
"configs.update",
"configs.delete",
"configs.read",
"configs.list",
"virtual_keys.create",
"virtual_keys.update",
"virtual_keys.delete",
"virtual_keys.read",
"virtual_keys.list",
"virtual_keys.copy"
]
)
print(api_key){
"id": "183f497a-2a7f-4f47-992e-26213fa863we",
"key": "abssofjosfjs",
"object": "api-key"
}Creates a new API key.
from portkey_ai import Portkey
# Initialize the Portkey client
portkey = Portkey(
api_key="PORTKEY_API_KEY",
)
# Create a new API key
api_key = portkey.api_keys.create(
name="API_KEY_NAME_0909",
type="organisation",
sub_type="service",
workspace_id="WORKSPACE_ID",
scopes=[
"logs.export",
"logs.list",
"logs.view",
"configs.create",
"configs.update",
"configs.delete",
"configs.read",
"configs.list",
"virtual_keys.create",
"virtual_keys.update",
"virtual_keys.delete",
"virtual_keys.read",
"virtual_keys.list",
"virtual_keys.copy"
]
)
print(api_key){
"id": "183f497a-2a7f-4f47-992e-26213fa863we",
"key": "abssofjosfjs",
"object": "api-key"
}Documentation Index
Fetch the complete documentation index at: https://portkey-docs-log-export-guide-1773064217.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
organisation, workspace user, service "Development API Key"
["completions.write"]"API key for development environment"
"ws-myworkspace"
Required when sub-type path parameter is 'user'. Not required when sub-type is 'service'.
"c3d4e5f6-a7b8-6c7d-0e1f-2a3b4c5d6e7f"
Show child attributes
Show child attributes
{
"credit_limit": 10,
"periodic_reset": "monthly",
"alert_threshold": 8
}Show child attributes
Was this page helpful?