px[0] is an open-source prompt infrastructure toolkit for managing prompts in production. It replaces hardcoded prompt strings with versioned templates, in-process caching, and OpenTelemetry observability, so teams can iterate on prompts without touching application code. This is the OpenAPI specification for all the public APIs of px0.
This Python package is automatically generated by the OpenAPI Generator project:
- API version: 1.0.0
- Package version: 0.1.2
- Generator version: 7.10.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
Python 3.8+
If the python package is hosted on a repository, you can install directly using:
pip install git+https://github.com/px0-ai/px0.git(you may need to run pip with root permission: sudo pip install git+https://github.com/px0-ai/px0.git)
Then import the package:
import px0Install via Setuptools.
python setup.py install --user(or sudo python setup.py install to install the package for all users)
Then import the package:
import px0Execute pytest to run the tests.
Please follow the installation procedure and then run the following:
import px0
from px0.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:3000
# See configuration.py for a list of all supported configuration parameters.
configuration = px0.Configuration(
host = "http://localhost:3000"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: BearerAuth
configuration = px0.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with px0.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = px0.APIKeysApi(api_client)
create_api_key_request = px0.CreateAPIKeyRequest() # CreateAPIKeyRequest |
try:
# Create an API Key
api_response = api_instance.create_api_key(create_api_key_request)
print("The response of APIKeysApi->create_api_key:\n")
pprint(api_response)
except ApiException as e:
print("Exception when calling APIKeysApi->create_api_key: %s\n" % e)All URIs are relative to http://localhost:3000
| Class | Method | HTTP request | Description |
|---|---|---|---|
| APIKeysApi | create_api_key | POST /v1/api-keys | Create an API Key |
| APIKeysApi | delete_api_key | DELETE /v1/api-keys/{id} | Delete an API Key |
| APIKeysApi | list_api_keys | GET /v1/api-keys | List API Keys |
| AuthApi | login | POST /v1/auth/login | Login |
| AuthApi | logout | DELETE /v1/auth/session | Logout |
| AuthApi | register | POST /v1/auth/register | Register a new user |
| AuthApi | reset_password | POST /v1/auth/password-reset/reset | Reset Password |
| AuthApi | trigger_password_reset | POST /v1/auth/password-reset/trigger | Trigger Password Reset |
| AuthApi | trigger_verification_email | GET /v1/auth/verify-email | Trigger Verification Email |
| AuthApi | verify_email | POST /v1/auth/verify-email | Verify User Email |
| HealthApi | health_check | GET /v1/health | Health Check |
| InboxApi | get_admin_inbox | GET /v1/me/inbox | Get Admin Inbox |
| InboxApi | resolve_join_request | PUT /v1/join-requests/{id} | Resolve Join Request |
| OrganizationsApi | create_org | POST /v1/orgs | Create Organization |
| OrganizationsApi | delete_org | DELETE /v1/orgs/{id} | Delete Organization |
| OrganizationsApi | list_org_people | GET /v1/orgs/{orgID}/people | List Org People |
| OrganizationsApi | remove_org_member | DELETE /v1/orgs/{orgID}/members/{userID} | Remove Member from Organization |
| OrganizationsApi | update_org | PUT /v1/orgs/{id} | Update Organization |
| ProfileApi | change_password | POST /v1/auth/me/change-password | Change Password |
| ProfileApi | delete_me | DELETE /v1/auth/me | Delete Me |
| ProfileApi | list_user_orgs | GET /v1/me/orgs | List User Organizations |
| ProfileApi | list_user_teams | GET /v1/me/teams | List User Teams |
| ProfileApi | me | GET /v1/auth/me | Me |
| ProfileApi | update_me | PUT /v1/auth/me | Update Me |
| PromptPayloadsApi | create_prompt_payload | POST /v1/prompts/{id}/payloads | Create a Prompt Payload |
| PromptPayloadsApi | delete_prompt_payload | DELETE /v1/prompts/{id}/payloads/{payloadID} | Delete a Prompt Payload |
| PromptPayloadsApi | get_prompt_payload | GET /v1/prompts/{id}/payloads/{payloadID} | Get a Prompt Payload |
| PromptPayloadsApi | list_prompt_payloads | GET /v1/prompts/{id}/payloads | List Prompt Payloads |
| PromptPayloadsApi | update_prompt_payload | PUT /v1/prompts/{id}/payloads/{payloadID} | Update a Prompt Payload |
| PromptRendersApi | render_live | POST /v1/prompts/{slug}/render | Render Live Prompt Version |
| PromptRendersApi | render_version | POST /v1/prompts/{slug}/versions/{version}/render | Render Specific Prompt Version |
| PromptVersionsApi | archive_version | POST /v1/prompts/{id}/versions/{version}/archive | Archive Prompt Version |
| PromptVersionsApi | create_version | POST /v1/prompts/{id}/versions | Create a Prompt Version |
| PromptVersionsApi | delete_prompt_version | DELETE /v1/prompts/{id}/versions/{version} | Delete Prompt Version Draft |
| PromptVersionsApi | demote_version | POST /v1/prompts/{id}/versions/{version}/demote | Demote Prompt Version |
| PromptVersionsApi | diff_versions | GET /v1/prompts/{id}/versions/diff | Diff Prompt Versions |
| PromptVersionsApi | duplicate_version | POST /v1/prompts/{id}/versions/{version}/duplicate | Duplicate Prompt Version |
| PromptVersionsApi | get_version | GET /v1/prompts/{id}/versions/{version} | Get Prompt Version |
| PromptVersionsApi | list_version_tags | GET /v1/prompts/{id}/tags | List Prompt Version Tags |
| PromptVersionsApi | list_versions | GET /v1/prompts/{id}/versions | List Prompt Versions |
| PromptVersionsApi | promote_version | POST /v1/prompts/{id}/versions/{version}/promote | Promote Prompt Version |
| PromptVersionsApi | remove_version_tag | DELETE /v1/prompts/{id}/tags/{tag} | Remove Version Tag |
| PromptVersionsApi | set_version_tag | POST /v1/prompts/{id}/versions/{version}/tags | Attach/Set Version Tag |
| PromptVersionsApi | update_version | PUT /v1/prompts/{id}/versions/{version} | Update Prompt Version Draft |
| PromptsApi | archive_prompt | POST /v1/prompts/{id}/archive | Archive a Prompt |
| PromptsApi | create_prompt | POST /v1/teams/{teamID}/prompts | Create a Prompt |
| PromptsApi | get_prompt | GET /v1/prompts/{id} | Get a Prompt |
| PromptsApi | list_all_prompts | GET /v1/prompts | List all prompts with team filter |
| PromptsApi | list_prompts | GET /v1/teams/{teamID}/prompts | List Prompts |
| PromptsApi | move_prompt | POST /v1/prompts/{id}/move | Move a Prompt |
| PromptsApi | restore_prompt | POST /v1/prompts/{id}/restore | Restore a Prompt |
| PromptsApi | update_prompt | PUT /v1/prompts/{id} | Update a Prompt |
| TeamManagementApi | create_team | POST /v1/orgs/{orgID}/teams | Create Team |
| TeamManagementApi | delete_team | DELETE /v1/teams/{id} | Delete Team |
| TeamManagementApi | list_org_teams | GET /v1/orgs/{orgID}/teams | List Org Teams |
| TeamManagementApi | update_team | PUT /v1/teams/{id} | Update Team |
| TeamsApi | create_join_request | POST /v1/teams/{id}/join-requests | Request to Join Team |
| TeamsApi | leave_team | DELETE /v1/me/teams/{teamID} | Leave Team |
| UserManagementApi | add_team_member | POST /v1/teams/{id}/members | Add Team Member |
| UserManagementApi | list_team_members | GET /v1/teams/{id}/members | List Team Members |
| UserManagementApi | remove_team_member | DELETE /v1/teams/{id}/members/{userID} | Remove Team Member |
| UserManagementApi | update_team_member_role | PUT /v1/teams/{id}/members/{userID}/role | Update Team Member Role |
- APIError
- APIKey
- APIKeyCreatedResponse
- AddTeamMemberRequest
- ChangePassword200Response
- ChangePasswordRequest
- CreateAPIKeyRequest
- CreateOrg201Response
- CreateOrgRequest
- CreatePrompt201Response
- CreatePromptPayload201Response
- CreatePromptPayloadRequest
- CreatePromptRequest
- CreateTeam201Response
- CreateTeamRequest
- CreateVersion201Response
- CreateVersionRequest
- DiffVersions200Response
- GetAdminInbox200Response
- GetPrompt200Response
- HealthCheck200Response
- InboxItem
- InboxItemPayload
- JoinRequestPayload
- ListAPIKeys200Response
- ListAllPrompts200Response
- ListOrgPeople200Response
- ListPromptPayloads200Response
- ListPrompts200Response
- ListTeamMembers200Response
- ListUserOrgs200Response
- ListUserTeams200Response
- ListVersionTags200Response
- ListVersionTags200ResponseTagsInner
- ListVersions200Response
- Login200Response
- LoginRequest
- MovePromptRequest
- Organization
- OrganizationWithRole
- Prompt
- PromptPayload
- PromptVersion
- Register201Response
- RegisterRequest
- RenderRequest
- RenderResponse
- ResetPassword200Response
- ResetPasswordRequest
- ResolveJoinRequestRequest
- SetVersionTagRequest
- Team
- TeamJoinRequest
- TeamMemberResponse
- TriggerPasswordReset200Response
- TriggerPasswordResetRequest
- TriggerVerificationEmail200Response
- UpdateMeRequest
- UpdateOrgRequest
- UpdatePromptPayloadRequest
- UpdatePromptRequest
- UpdateTeamMemberRole200Response
- UpdateTeamMemberRoleRequest
- UpdateTeamRequest
- UpdateVersionRequest
- User
- VerifyEmail200Response
- VerifyRequest
Authentication schemes defined for the API:
- Type: Bearer authentication