One API for the AI models in your app, and agents that use your own functions
The Playcode SDK now calls AI models: playcode.ai. Your app reaches the Claude, GPT and Gemini models Playcode offers it through one API, and switching models is a change of one id.
- One call for every model.
generate()answers,stream()answers as it writes, and both read images and PDFs. Give aschema(zod or JSON Schema) and the answer comes back as a checked, typed object. - Agents.
agent()lets a model call your app's own functions in a loop. A run stops at its step limit, at its credit budget, when the balance runs out, or when you cancel it. In new Cloud apps, a run is saved as it goes, survives a restart, and goes on from its last finished step. - What a call cost. Every answer says the credits it used, by the model's published price.
- Live models.
models()lists the models your app can call, with what each reads, its limits, where it is processed and its price. A new model reaches your app without a code change. - The changelog ships in the package.
CHANGELOG.mdsays what changed in each version and what to do when you upgrade. When the agent updates your app's SDK, it reads it first.
Ask the agent to add AI to your app: new Cloud apps come with it, and the agent updates an older app's SDK before it builds.
Try it: Add an assistant to my app that books appointments using my calendar.