Using your API key
All API endpoints are authenticated using the API key you have been provided. Pass the API key in theAuthorization header:
Creating a project
Projects are the core resource in the Specular API. Each project represents a full backend with an isolated database and deployment. You should create a new project for each of your user’s projects. When a new project is created, an initial branch is also created and returned in the response. When a user starts a new project on your platform, call the create project endpoint with a name:Using your own Git repo
By default, we will manage the code for each project. You can also bring your own Git repo, to which we will commit and push changes as they are made. If you want to provide your own Git repo, you can pass the details to connect to it as shown below. Before doing so, you should create an initial development branch for us to push to:Connecting your coding agent
After having created your project, you will receive anmcpUrl associated with the initial branch created automatically. You should connect your coding agent to this MCP to let it build and evolve the backend it needs through natural language prompts. Once the build is complete, it will return an OpenAPI schema that your coding agent can use as a reference for how to integrate with the backend.
The MCP has a simple interface consisting of two endpoints:
make_changewhich accepts a natural-language prompt guiding our coding agent to make changes to the backend. This will run asynchronously andget_statusshould be used to check if the building is done.get_statuswhich returns the status of the current build. It will also return an OpenAPI spec for the backend which describes the schema of the built API. Your coding agent can use this to integrate with the API.
get_status through the MCP, you can also poll the API to retrieve the same information:
state will be building if a change is currently being built and idle when it’s done.
Managing environment variables
Environment variables let you configure your backend with API keys, secrets, and other configuration values. Each branch has its own set of environment variables that are available to your coding agent and running application. When creating a new branch, existing production environment variables are automatically copied to it, giving you a starting point that matches production.Setting environment variables
To set or update environment variables for a branch:Listing environment variables
Retrieve all environment variables for a branch:Deleting environment variables
Remove an environment variable:Environment variables in production
When you merge a branch to production, its environment variables are automatically merged to production as well, overwriting any existing values with the same name. This ensures your production deployment uses the configuration you tested in development.Refreshing a branch
You can refresh a branch to restart the application with the latest code changes and environment variables:Merging and deploying projects
Once your coding agent has built the backend you need, you can merge it to production with a single API call. This will validate the changes, merge to your main branch, apply database migrations, and deploy your backend to production infrastructure.Triggering a deployment
To deploy a branch to production, call the merge endpoint:202 Accepted status:
Monitoring deployment progress
You can poll the branch status to check if the merge is complete:state will be:
merging- Deployment is in progressmerged- Deployment completed successfullyidle- Branch has not been merged, or there was an error