> ## Documentation Index
> Fetch the complete documentation index at: https://docs.easy-peasy.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Transcription

> Programmatically create [AI Transcriptions](https://easy-peasy.ai/audios) from audio files.

## Complete Workflow

Transcription is asynchronous — after submitting an audio file, you need to poll for results. Here's the full workflow:

### Step 1: Submit audio for transcription

Use this endpoint to upload your audio file. The response includes a `uuid` you'll need for the next steps.

<Note>
  Transcription typically takes **1–5 minutes** depending on audio length. Save the `uuid` from the response.
</Note>

### Step 2: Poll for results

Use [Get Transcription Result](/api-reference/endpoint/get-transcription) to check if the transcription is complete. **Poll every 15–30 seconds** until the `content` field is populated.

The transcription is ready when the response includes a non-empty `content` field and a `segments` array with timestamped text.

```javascript theme={null}
async function waitForTranscription(uuid, apiKey) {
  const maxAttempts = 40; // ~10 minutes max

  for (let i = 0; i < maxAttempts; i++) {
    const response = await fetch('https://easy-peasy.ai/api/audios', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'x-api-key': apiKey
      },
      body: JSON.stringify({ audio_id: uuid })
    });

    const data = await response.json();

    if (data.audio.content) {
      return data; // Transcription complete!
    }

    await new Promise(resolve => setTimeout(resolve, 15000));
  }

  throw new Error('Transcription timeout');
}
```

### Step 3: Generate AI content (optional)

Once the transcription is complete, use [Generate Audio Content](/api-reference/endpoint/generate-audio-content) to create summaries, titles, action items, and more.

```bash theme={null}
curl -X POST https://easy-peasy.ai/api/generate-audio-content \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{"audio_id": "YOUR_AUDIO_UUID"}'
```

You can also generate specific fields only:

```bash theme={null}
curl -X POST https://easy-peasy.ai/api/generate-audio-content \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "audio_id": "YOUR_AUDIO_UUID",
    "fields": ["summary", "title", "keywords"]
  }'
```

**Content generated depends on the audio type:**

| Audio Type          | Fields                                                                                                                                                   |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Meeting**         | summary, title, description, action items, keywords, timestamped overview, topics & bullets, LinkedIn post                                               |
| **Podcast**         | summary, title, description, show notes, Twitter thread, article, newsletter, keywords, questions, LinkedIn post, timestamped overview, topics & bullets |
| **Therapy Session** | summary, title, description, progress note, SOAP note, DAP note, keywords, timestamped overview, topics & bullets, LinkedIn post                         |


## OpenAPI

````yaml POST /api/transcriptions
openapi: 3.0.1
info:
  title: Easy-Peasy.AI API
  description: >-
    OpenAPI Specifications for the Easy-Peasy.AI API.


    All API requests must be authenticated with an API key. Include the
    `x-api-key` API key in the request header with all requests. You can get the
    API key [here](https://easy-peasy.ai/settings/api).
  version: 1.0.4
servers:
  - url: https://easy-peasy.ai
security:
  - apiKeyAuth: []
paths:
  /api/transcriptions:
    post:
      summary: Create Transcription
      description: >-
        Programmatically create [AI
        Transcriptions](https://easy-peasy.ai/audios) from audio files.
      operationId: createTranscription
      parameters:
        - name: x-api-key
          in: header
          required: true
          schema:
            type: string
          description: Your API key
          example: 27feb2bb-aeb4-4a83-9fb6-8f3f2a15885e
      requestBody:
        description: The audio parameters to create transcriptions
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TranscriptionRequest'
      responses:
        '200':
          description: Successful transcription creation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TranscriptionResponse'
        '400':
          description: Bad request - missing required fields or invalid values
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Invalid input
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Server error
components:
  schemas:
    TranscriptionRequest:
      type: object
      required:
        - url
      properties:
        audio_type:
          type: string
          description: The type of audio (e.g., podcast, meeting)
          example: podcast
        language:
          type: string
          description: The language of the audio (e.g., English, Chinese, French)
          example: English
        name:
          type: string
          description: The name of the transcription
          example: Interview with John Doe
        detect_speakers:
          type: boolean
          description: Whether to detect multiple speakers
          example: true
        enhanced_quality:
          type: boolean
          description: Whether to use enhanced quality for transcription
          example: true
        url:
          type: string
          description: The URL of the audio file
          example: https://example.com/audiofile.mp3
    TranscriptionResponse:
      type: object
      properties:
        uuid:
          type: string
          description: Unique identifier for the created transcription
          example: 4bc4e8ee-f29e-4a53-996e-5da955c42927
        dashboard_url:
          type: string
          description: URL of the generated transcription
          example: https://easy-peasy.ai/audios/4bc4e8ee-f29e-4a53-996e-5da955c42927
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error message
          example: Invalid API key
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key for authentication. Get yours at
        https://easy-peasy.ai/settings/api

````