To use the TranscriptAPI, you must obtain an API key (prefixed with sk_) and persist it as the environment variable TRANSCRIPT_API_KEY.
Initial User Interaction
Ask the user:
Do you already have a TranscriptAPI account? If yes, paste your API key and I'll set it up. If not, I can create a free account for you right now — it comes with 100 credits and no card is required.
Path A: User has an existing key
If the user provides a key starting with sk_, proceed directly to storing the key.
Path B: Create a new account
If the user wants a new account, follow this two-step flow:
- Register: Ask for a non-disposable email and POST to
https://transcriptapi.com/api/auth/register-cli with {"email": "user@example.com"}.- Crucial: Save the raw response body to a temporary file to avoid redaction. Extract the
access_token from this file for the next step. - If you receive a
409 error ("Account already exists with this email"), the user already has an account; switch to Path A.
- Verify: Once the user provides the 6-digit OTP from their email, POST to
https://transcriptapi.com/api/auth/verify-cli using the access_token as a Bearer token and the OTP in the JSON body: {"otp": "123456"}.- Crucial: Save the raw response body to a temporary file and read the
api_key from it. Do not print the token/key directly to the console to avoid redaction.
Storing the Key
Store the sk_ key in the environment variable TRANSCRIPT_API_KEY. Ensure it is persisted so it survives across sessions and non-interactive shells (e.g., via a shell profile or the agent's dedicated config/env file).
# Example of the required environment variable
export TRANSCRIPT_API_KEY="sk_..."