CloudDevin
hands you one as api, already authenticated with the same key and pointed at the same base URL
as the session connection:
api is cloud-only: a LocalDevin runs the CLI on your machine and has no cloud session to ask
about. You can also construct the client on its own without opening a session connection:
Shape of the client
devin.api is a DevinApiClient. Each REST resource is a property holding a resource client
(devin.api.sessions is a SessionsClient, devin.api.enterprise.auditLogs an
EnterpriseAuditLogsClient), and each REST operation is one method taking a single request
object: path parameters, query parameters and body fields flattened together, with the names the
API uses (org_id, devin_id).
RequestOptions: timeoutInSeconds,
maxRetries (default 2), abortSignal, extra headers, queryParams. Failures throw a
DevinApiError with statusCode, the parsed body, and the rawResponse;
DevinApiTimeoutError when the request timed out.
Page: page.data is the first page, and iterating the
page fetches the rest as needed.
DevinApi namespace (DevinApi.SessionResponse,
DevinApi.CreateSessionRequest), also exported from the package. Raw HTTP details are available
per call through .withRawResponse().
Where this reference comes from
The pages in this section are generated from the client’s TypeScript source, not written by hand. The client itself is generated by Fern from the OpenAPI spec of the Devin REST API (v3); a generation step first turns each operation’s dottedoperationId (sessions.createSession) into the resource client and method
name you call, and adds pagination annotations. TypeDoc then reads the generated code, so what you see here is what
ships in the package, including Fern’s JSDoc and the examples it derives from the spec.
Because the resource clients are only reachable through devin.api.*, not as top-level exports,
the reference exports them under their own names, and nested resources under a path-qualified
name where Fern reuses a class name: devin.api.enterprise.sessions is documented as
EnterpriseSessionsClient, distinct from the top-level SessionsClient.
Fern writes its examples against a bare client variable:
client.sessions.createSession(…). Read
client as devin.api.
