Overview
Ask Devin to build a small API service in its own environment, install what it needs, call every endpoint, add clear error responses with tests, and open a pull request you review.
Problem or Objective
- Which agents build a non-trivial feature with you?
- Which agents write or run tests against an application?
More in Coding and Code Review
AI Agents and Models
Tools and Integrations
- Tools
- Devin
- Prerequisites
- A Devin account connected to your code host.
How It Works
Write a short spec for the service: the endpoints, the request and response shapes, the language and framework, and how each error should look, for example a 400 with a message for bad input and a 404 for a missing record. Start a Devin session with the spec and an empty repository or a new folder in an existing one. Ask Devin to install the packages it needs, write the service, add a test for every endpoint including each error case, start the service and call each endpoint, then show you the test output. Watch its terminal if you want, and step in if it drifts from the spec. Review the pull request yourself, run the tests locally, and merge only when you are satisfied.
Implementation Workflow
Steps assembled from the agents, tools and prompt of this entry. Adapt them to your own setup.
- Choose the agentSet up Devin.
- Connect the toolsConnect the tools this workflow relies on: Devin.
- Check the prerequisitesA Devin account connected to your code host.
- Gather your detailsCollect what the prompt asks for: Language and framework, Repository, Endpoints, Error response format.
- Run the starter promptPaste the starter prompt below into Devin and adapt it to your case.
- Check against the documentationCompare what you get with the documentation at docs.devin.ai before you rely on it.
Practical Starter Prompt: Build and test a small API
Fill the fields to adapt the prompt. Empty fields stay as visible [placeholders].
Build a small [Language and framework] API service in [Repository] with these endpoints: [Endpoints]. Install only the packages you need. For errors, return [Error response format], with 400 for invalid input and 404 for missing records. Write a test for every endpoint, including each error case, then start the service, call each endpoint, and show me the test output. Use only made-up test data. Open a pull request when done and do not merge it.Review the pull request, run the tests yourself and merge only after you approve it.
Expected Results and Benefits
This is a suggested workflow, not a reported result. The points below are what the cited documentation says the tools can do.
This is a suggested workflow, not a reported outcome. Devin's docs describe an AI software engineer that can write, run and test code, with a full desktop environment including a shell, IDE and browser, and say tasks with a clear start, end and success criteria work best. They do not report timings or quality for small API projects.
Limitations and Considerations
A small exercise like this does not show that authentication, authorization or deployment are ready for production; review those separately. Check how your organisation grants access to Devin and how sessions count against your plan. Keep secrets out of the spec and use test data only. Results depend on your setup and were not independently reproduced by Top 200 Repos.
Sources
- Introducing Devin - Devin Docs (opens in a new tab)
Project documentation · docs.devin.ai · Undated · Source checked 26 Nov 2026, 17:27 UTC
What this source supports
- Devin is an autonomous AI software engineer that can write, run and test code.
- Devin’s terminal shows commands being executed and their output logs; you can also copy the shell output for debugging purposes.
- When to Use Devin - Devin Docs (opens in a new tab)
Project documentation · docs.devin.ai · Undated · Source checked 26 Nov 2026, 17:27 UTC
What this source supports
- Devin has a full desktop environment with a shell, IDE, and browser.
- Good tasks have a clear start and end, plus explicit success criteria; tasks with test suites, CI checks, or verifiable outcomes yield the best results.