Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Connect Apple Music to ChatGPT on Web & Mobile

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Yes, you can connect Apple Music to ChatGPT, but only through the ChatGPT Actions (formerly Plugins) feature, not as a native integration. This lets ChatGPT search your library, create playlists, and control playback on your behalf—but only after you grant permission via Apple's MusicKit API. You'll need an active Apple Music subscription (not just iTunes Match), a Mac or PC to create an API key, and the official ChatGPT app (web or mobile) with a Plus, Pro, or Team plan, since Actions require a paid subscription. Below are the exact steps for both web and mobile.

What You'll Need

  • An Apple Music subscription (individual, student, or family plan)
  • A ChatGPT Plus, Pro, or Team account (Actions are not available on the free tier)
  • A computer with a web browser to create an Apple Music API key (you can do this on a Mac or PC)
  • The official ChatGPT app installed on your iPhone, iPad, or Android device (for mobile steps)
  • An Apple Developer account (free tier is sufficient for this)

Step-by-Step

Important: Menu labels and button names can vary slightly by app version, device, and region. The steps below follow the current official interfaces as of this writing.

Part 1: Create an Apple Music API Key (Do this once on a computer)

  1. Go to developer.apple.com and sign in with your Apple ID (the same one used for Apple Music).
  2. Click "Certificates, Identifiers & Profiles" in the left sidebar.
  3. Under "Keys," click the plus (+) button to register a new key.
  4. Enter a name (e.g., "ChatGPT Music"), then check the box for "MusicKit" under the Services list.
  5. Click "Continue," then "Register." Download the .p8 file when prompted—this is your private key. Keep it safe; you'll only get it once.
  6. Note the Key ID (a string like "ABC123DEFG") and your Team ID (found in the top-right of the developer portal under your name).

Part 2: Set Up the Custom Action in ChatGPT (Web)

  1. Open chatgpt.com in your browser and sign in.
  2. Click your profile icon (bottom-left) and select "Settings" (or "Customize ChatGPT").
  3. In the Settings menu, click "Actions" (or "Plugins" if you see that).
  4. Click "Create new action."
  5. In the "Authentication" section, select "API Key" and paste a dummy key (like "test")—you'll replace it later with a real token.
  6. In the "Schema" section, you'll need to provide an OpenAPI schema. Use a pre-made Apple Music schema (search online for "ChatGPT Apple Music OpenAPI schema"—many users share one). If you're comfortable writing JSON, create your own with endpoints like /v1/me/library and /v1/me/playlists.
  7. Click "Save" and then "Enable" the action.

Part 3: Generate a MusicKit Token and Connect (Web)

  1. Apple Music requires a short-lived JSON Web Token (JWT) for API calls. To generate one, you'll need a token generator tool. You can use a free online JWT generator or a script (like a Python script) that signs your .p8 key.
  2. After generating a token (valid for 15 minutes), copy it.
  3. Go back to your ChatGPT action settings, click the action you created, and replace the dummy API key with your actual JWT token.
  4. Save the action. Now, when you ask ChatGPT to "play a song from Apple Music," it will use that token to make API calls.

Part 4: Connect on Mobile (iPhone/Android)

  1. Open the ChatGPT app on your phone or tablet.
  2. Tap the menu (hamburger icon) in the top-left corner.
  3. Tap your profile icon, then select "Settings."
  4. Scroll to "Actions" (or "Plugins") and tap it.
  5. You'll see the action you created on the web. Toggle it on if it's not already.
  6. When you first use the action, ChatGPT will ask for permission to access your Apple Music data. Tap "Allow" to grant access.

Common Mistakes

  • Using the wrong key: The .p8 file is your private key, not the API key field in ChatGPT. The API key field expects a JWT token, which you must generate separately.
  • Token expiry: MusicKit tokens expire after 15 minutes. If you paste one into ChatGPT and wait too long, it will fail. You'll need to regenerate and update it each time—this is a known limitation.
  • Not enabling MusicKit: When creating the key in Apple Developer, you must check the MusicKit box. If you skip it, the key won't work.
  • Free ChatGPT plan: Actions are only available on paid plans. If you're on the free tier, you won't see the Actions section at all.
  • Wrong region: Apple Music API may not be available in all countries. Check Apple's developer documentation for regional availability.

Tips

  • Use a token generator script that refreshes automatically if you're comfortable with coding—this saves you from manually updating the token every 15 minutes.
  • Start with simple requests like "search for 'Blinding Lights' on Apple Music" to test the connection before trying complex playlist creation.
  • Keep your .p8 file in a secure location—anyone with it can access your Apple Music data.
  • If you're on an iPhone, you can also use Siri Shortcuts to control Apple Music, but that's separate from ChatGPT.

Troubleshooting

  • Action not showing in mobile app: Make sure you're logged into the same ChatGPT account on both web and mobile. Log out and back in if needed.
  • Authentication error: Double-check that your JWT token is correctly formatted and not expired. Regenerate a fresh token and update the action.
  • "No results" from music search: The API may not return results if your token lacks proper permissions. Recreate the key and ensure MusicKit is enabled.
  • ChatGPT says "Action not available": This usually means the schema is malformed. Try a different schema from a trusted source.
  • If none of this works: There is no official Apple Music integration from OpenAI, so this workaround is community-driven. If it breaks, check ChatGPT's official documentation or forums for updated schemas.

Frequently Asked Questions

Can I connect Apple Music to ChatGPT without a paid plan?

No. Actions are a paid feature, so you need ChatGPT Plus, Pro, or Team.

Does this work on Android?

Yes, the ChatGPT app on Android supports Actions, so the same steps work.

Will my Apple Music playlists sync with ChatGPT?

Only if you explicitly ask ChatGPT to create or modify playlists via the API. It won't automatically sync.

Is this an official Apple integration?

No. It's a custom Action using Apple's MusicKit API. OpenAI has not released an official Apple Music integration.

Why does my token expire so quickly?

Apple's MusicKit tokens are designed to be short-lived (15 minutes) for security. You must generate a new one each time you want to use the action.

Can I use this to play music on my HomePod?

No. The API can control playback on your device, but not directly on a HomePod. You'd need to use AirPlay separately.