Wispera provides an API to easily retrieve prompts and run them as part of your application. Prompts can then be managed independently of application code allowing you to continually enhance your AI features without code changes.

Authentication

All API endpoints are authenticated using Bearer tokens. To use the API, follow these steps:

1. Obtain Access Token

First, call the Wispera authorization endpoint to receive an access token:

curl --request POST \
  --url https://login.wispera.ai/oauth/token \
  --header 'content-type: application/json' \
  --data '{
    "client_id": "<your_client_id>",
    "client_secret": "<your_client_secret>",
    "audience": "https://api.wispera.ai",
    "grant_type": "client_credentials"
  }'

2. Token Response

You will receive a response containing your access token:

{
  "access_token": "<access_token_value>",
  "token_type": "Bearer"
}

3. Using the Access Token

Include the access token in the authorization header for all API requests:

curl --request GET \
  --url https://app.wispera.ai/api/prompts/ \
  --header 'authorization: Bearer <access_token_value>'

API Object Types

The Wispera API provides access to the following main object types:

  1. Personas: Define AI personalities and their characteristics
  2. Audiences: Specify target user groups for AI interactions
  3. Prompts: Manage AI instruction templates
  4. Clauses: Handle reusable prompt components
  5. Assistants: Combine personas, audiences, and prompts with LLMs
  6. Packs: Organize and group related AI resources
  7. Playgrounds: Test and experiment with AI interactions

Each object type has its own set of endpoints for creating, reading, updating, and deleting resources. Refer to the specific sections in this documentation for detailed information about working with each type.