API Reference
Virtual Keys
Prompts
- POSTCreate Prompt
- GETList Prompts
- GETRetrieve Prompt
- PUTUpdate Prompt
- DELDelete Prompt
- PUTPublish Prompt
- GETList Prompt Versions
- GETRetrieve Prompt Version
- PUTUpdate Prompt Version
- Prompt Partials
- Prompt Labels
- Prompt Collections
API Keys
Analytics [BETA]
- Summary
- Groups Paginated Data
- Graphs - Time Series Data
User Invites
Workspaces
Workspace Members
OpenAPI
Create Config
POST
/
configs
from portkey_ai import Portkey
portkey = Portkey(
api_key="PORTKEY_API_KEY",
)
# Create a new configuration
config = portkey.configs.create(
name="ConfigName_0909",
config={
"retry": {
"attempts": 3
},
"cache": {
"mode": "simple"
}
},
workspace_id="WORKSPACE_ID",
)
print(config)
{
"success": true,
"data": {
"id": "f3d8d070-f29d-43a3-bf97-3159c60f4ce0",
"version_id": "0db4065b-ead2-4daa-bf5e-7e9106585133"
}
}
Authorizations
Body
application/json
optional, when using organisation admin API keys
Was this page helpful?
from portkey_ai import Portkey
portkey = Portkey(
api_key="PORTKEY_API_KEY",
)
# Create a new configuration
config = portkey.configs.create(
name="ConfigName_0909",
config={
"retry": {
"attempts": 3
},
"cache": {
"mode": "simple"
}
},
workspace_id="WORKSPACE_ID",
)
print(config)
{
"success": true,
"data": {
"id": "f3d8d070-f29d-43a3-bf97-3159c60f4ce0",
"version_id": "0db4065b-ead2-4daa-bf5e-7e9106585133"
}
}