Create Config

Create a config

post
Authorizations
Body
namestringOptional
configobjectOptional
isDefaultintegerOptional
workspace_idstring · uuidOptional

optional, when using organisation admin API keys

Responses
200
Config created successfully
application/json
post
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)
200

Config created successfully

{
  "success": true,
  "data": {
    "id": "f3d8d070-f29d-43a3-bf97-3159c60f4ce0",
    "version_id": "0db4065b-ead2-4daa-bf5e-7e9106585133"
  }
}

Last updated

Was this helpful?