# Create a Podcast Episode

Generate your first AI-powered podcast episode in just a few simple steps. This guide will walk you through creating a podcast from web resources and retrieving the generated audio.

## Step 1: Create Content Request

Send a POST request to `/content/create` with your resources and specify `audio` as the output type:

```bash
curl -X POST "https://api.autocontentapi.com/content/Create" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "resources": [
      {
        "type": "website",
        "content": "https://example.com/article-about-ai"
      },
      {
        "type": "youtube", 
        "content": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
      }
    ],
    "outputType": "audio",
    "text": "Create an engaging podcast discussion about AI developments",
    "duration": "long"
  }'
```

### Example Response

```json
{
  "request_id": "550e8400-e29b-41d4-a716-446655440000",
  "status": 0
}
```

**Important:** Save the `request_id` - you'll need it to check the status and retrieve your audio!

## Step 2: Poll for Status

Use the `request_id` to check the processing status by calling `/content/Status/{id}`:

```bash
curl -X GET "https://api.autocontentapi.com/content/Status/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
```

### While Processing

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "status": 5,
  "updated_on": "2024-01-15T10:32:00Z",
  "error_code": 0,
  "requested_on": "2024-01-15T10:30:00Z"
}
```

**Status Codes:**

* `0` = Pending (queued for processing)
* `5` = Processing (generation in progress)
* `100` = Completed (audio ready!)

## Step 3: Get Your Audio

When `status` reaches `100`, the response includes your generated audio:

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "audio_title": "AI Developments Discussion",
  "status": 100,
  "audio_url": "https://storage.autocontentapi.com/audio/550e8400-e29b-41d4-a716-446655440000.mp3",
  "response_text": "Full transcript of the generated podcast...",
  "requested_on": "2024-01-15T10:30:00Z",
  "updated_on": "2024-01-15T10:35:00Z",
  "request_type_id": 1,
  "error_code": 0,
  "file_size": 15234567,
  "audio_duration": 456.78,
  "share_url": "https://autocontentapi.com/share/550e8400-e29b-41d4-a716-446655440000"
}
```

**🎉 Success!** Your podcast is ready at the `audio_url`!

## Resource Types

You can use different types of resources in your request:

| Type      | Description         | Example                                      |
| --------- | ------------------- | -------------------------------------------- |
| `website` | Any web page URL    | `"https://techcrunch.com/article"`           |
| `youtube` | YouTube video URL   | `"https://www.youtube.com/watch?v=VIDEO_ID"` |
| `text`    | Direct text content | `"Your custom instructions or content"`      |
| `pdf`     | PDF document URL    | `"https://example.com/document.pdf"`         |

## Duration Options

Control the length of your generated podcast:

* `"short"` - 3-5 minutes
* `"default"` - 8-12 minutes
* `"long"` - 15-20 minutes

## Tips for Better Results

1. **Mix resource types** - Combine websites, videos, and text for richer content
2. **Provide clear instructions** - Use the `text` field to guide the conversation
3. **Check status regularly** - Processing typically takes 2-5 minutes
4. **Save the request\_id** - You'll need it to retrieve your audio

## Error Handling

If something goes wrong, the status response will include error details:

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "status": 0,
  "error_code": 400,
  "error_message": "Invalid resource URL provided",
  "requested_on": "2024-01-15T10:30:00Z"
}
```

## What's Next?

* 📖 Explore more [Code Samples](../code-samples) in different languages
* 🗣️ Learn about [Custom Voices](../voices) for personalized podcasts
* 🔮 Check out [Advanced Integrations](../integrations)
* ❓ Have questions? Visit our [FAQ](../faq)
