Skip to main content
One Gemini API key covers all three kinds of AI work in MagicPost:
  • Writing models draft captions, adapt a post for several networks and write alt text.
  • Picture models create new pictures and edit pictures from your media library.
  • Video models make short clips from a description or from a starting picture.
There is one Google key. The Google Gemini field on Writing Models and the Google field on Media Models read and write the same stored key.

Before you start

  • You can sign in to the MagicPost admin panel.
  • You have a Google account that can use Google AI Studio.
  • Billing is set up on the Google Cloud project that owns the key if the models you want need it. Google bills you directly for every request. This is separate from the credits your users spend in MagicPost.

Get an API key

1

Open the API keys page

Go to aistudio.google.com/apikey and sign in. Accept the terms if this is your first visit.
2

Choose the project

New users get a default Google Cloud project. If you already use Google Cloud, AI Studio does not list your projects until you import them. Open Dashboard → Projects, click Import projects, select the project and import it.
3

Create the key

On the API Keys page click Create API key, choose the project and create it. Copy the key.
Google’s API key guide says the Gemini API rejects unrestricted standard keys, and that new keys created in AI Studio are authorization keys. A new key made in AI Studio works with MagicPost, which sends it in the x-goog-api-key header.

Add the key in MagicPost

1

Open Writing Models

Go to Admin → Publishing → Writing Models.
2

Paste the key

In the Provider keys box, paste the key into the Google Gemini field and click Save keys. The toast reads Keys saved. and the Google Gemini card shows Key stored.
3

Switch on the writing models

Turn on the switch next to each model you want to offer, then click Test on one of them. MagicPost sends a one-word request and shows either that the model answered or the error Google returned.
4

Check the picture and video models

Open Admin → Publishing → Media Models. The Google field already holds the same key and the card shows Key stored. Switch on the models you want. Click Test on a picture model. MagicPost asks for one small picture, so the test makes a real, billable request. Video models have no Test button.

Starting models

The installer loads this list. Identifiers are as shipped and can be corrected later (see Model identifiers). Credits are MagicPost credits, not Google prices, and you can change them on the model. Writing Models Media Models A clip costs its credits per second times its length. For example, an 8 second clip on Veo 3.1 Fast starts at 32 credits.

How MagicPost calls Google

  • Writing, pictures and clips all use the Gemini API at generativelanguage.googleapis.com.
  • A request for several pictures from a Gemini picture model is made as several calls, one picture each.
  • Clips are started as a long-running job. A background job asks Google for the result and downloads the clip when it is ready, so cron or a queue worker must be running. See Cron and queue.
  • Video shapes other than 16:9 and 9:16 are sent as 16:9.
  • If Google rejects temperature or a thinking setting by name on a writing model, MagicPost sends the request again without it and remembers that for the model.

Troubleshooting