This guide creates a dedicated AI Studio App for the project and obtains the app link required by the AI_STUDIO_APP_URL environment variable.
Sign in to your Google account, then open the AI Studio blank app.
Click Remix in the upper-right corner. Do not use the Remix button beside the prompt box in the lower-left corner.
Change the App name in the dialog. You may also update the Description. Then click Remix app in the lower-right corner.
Wait for the copy to be created. After your app name appears at the top, click Code above the preview area to open the code editor.
Replace the complete contents of these files in the code editor:
- Open
index.tsin the AI Studio App, delete its existing contents, then copy and paste the complete contents of this project'sscripts/client/build.js. - Open
index.htmlin the AI Studio App, delete its existing contents, then copy and paste the complete contents of this project'sscripts/client/index.html.
Click Save at the bottom of the editor when finished. You can also press Ctrl+S (Command+S on macOS).
Copy the files from the version of the repository you are currently using. If a future project update changes either file, replace the corresponding App file again and save it.
Click Preview above the preview area and wait about 10 seconds. The following error means the client code is running and waiting for this project to establish a connection; it is expected here:
Error: ❌ Failed to get authIndex: authIndex postMessage timeout (10s)
AI Studio may also show a code error count on the left or at the bottom. Do not click Fix and let AI rewrite the code. You can continue as long as Preview displays the authIndex postMessage timeout (10s) message above.
- Click Share in the upper-right corner. You do not need to click Publish.
- Under General access, select Public: Anyone with the link can view.
- Click Copy link at the bottom of the sharing panel.
The copied link should look like this:
https://ai.studio/apps/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Add the complete link to the .env file in the project root:
AI_STUDIO_APP_URL=https://ai.studio/apps/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxSave .env and restart AIStudioToAPI. The AI Studio App URL entry in the startup log should show the URL you configured.
The App must remain Public, or the Google account running AIStudioToAPI may be unable to open it. A public link also allows anyone who has it to view the App, so never add API keys, cookies, or other secrets to
index.tsorindex.html.




