First steps

Get started with LMNT

Make your first API call to LMNT and build a simple storyteller.

Prerequisites

Call the API

  1. Set your API key

    Get your API key from the Playground and set it as an environment variable:

    export LMNT_API_KEY=your-api-key

    To persist the key across shell sessions, add the line to your shell profile (such as ~/.zshrc or ~/.bashrc).

  2. Write your code

    Save this as quickstart.sh:

    curl --request POST \
      --url https://api.lmnt.com/v1/ai/speech/bytes \
      --header "X-API-Key: $LMNT_API_KEY" \
      --header 'Content-Type: application/json' \
      --data '{
        "text": "The lazy yellow dog was caught by the slow red fox as he lay sleeping in the sun.",
        "voice": "leah"
      }' \
      --output story.mp3
  3. Run your code
    bash quickstart.sh
    Example output
    wrote ~32 KB to story.mp3

Next steps

You've made your first API call. Next, learn the Speech API patterns you'll use in every LMNT integration.

Working with the Speech API

Learn how to get word timestamps if you want them, generating conversational speech, and other core patterns.

Once you're comfortable with the basics, explore further: