---
title: "Download build target output"
method: GET
path: "/v0/build_target_outputs"
---

# Download build target output

`GET /v0/build_target_outputs`

Retrieve a method to download an output for a given build target.

If the requested type of output is `source`, and the requested output
method is `url`, a download link to a tarball of the source files is
returned. If the requested output method is `git`, a Git remote, ref,
and access token (if necessary) is returned.

Otherwise, the possible types of outputs are specific to the requested
target, and the output method _must_ be `url`. See the documentation for
`type` for more information.

## Query parameters

- `build_id` string, required — Build ID
- `target` 'node' | 'typescript' | 'python' | 'go' | 'java' | 'kotlin' | 'ruby' | 'terraform' | 'cli' | 'php' | 'csharp' | 'sql' | 'openapi', required — SDK language target name
- `type` union, required
  - 'source' — The raw source code generated by Stainless
  - 'dist' — TypeScript: compiled dist tarball
  - 'wheel' — Python: wheel distribution package
  - 'openapi-with-transforms' — OpenAPI: spec with transforms applied
  - 'openapi-with-code-samples' — OpenAPI: spec with code samples
  - 'openapi-sdk-spec' — OpenAPI: internal SDK specification JSON
- `output` 'url' | 'git' — Output format: url (download URL) or git (temporary access token).

## Response `200`

success

- union
  - object
    - `output` 'url', required
    - `type` union, required
      - 'source' — The raw source code generated by Stainless
      - 'dist' — TypeScript: compiled dist tarball
      - 'wheel' — Python: wheel distribution package
      - 'openapi-with-transforms' — OpenAPI: spec with transforms applied
      - 'openapi-with-code-samples' — OpenAPI: spec with code samples
      - 'openapi-sdk-spec' — OpenAPI: internal SDK specification JSON
    - `target` 'node' | 'typescript' | 'python' | 'go' | 'java' | 'kotlin' | 'ruby' | 'terraform' | 'cli' | 'php' | 'csharp' | 'sql' | 'openapi', required
    - `url` string, required — URL for direct download
  - object
    - `output` 'git', required
    - `type` union, required
      - 'source' — The raw source code generated by Stainless
      - 'dist' — TypeScript: compiled dist tarball
      - 'wheel' — Python: wheel distribution package
      - 'openapi-with-transforms' — OpenAPI: spec with transforms applied
      - 'openapi-with-code-samples' — OpenAPI: spec with code samples
      - 'openapi-sdk-spec' — OpenAPI: internal SDK specification JSON
    - `target` 'node' | 'typescript' | 'python' | 'go' | 'java' | 'kotlin' | 'ruby' | 'terraform' | 'cli' | 'php' | 'csharp' | 'sql' | 'openapi', required
    - `token` string, required — Temporary GitHub access token
    - `url` string, required — URL to git remote
    - `ref` string, required — Git reference (commit SHA, branch, or tag)

---

[API](https://skmtc.net/stainless-api/apis/my-api.md) · [All operations](https://skmtc.net/stainless-api/apis/my-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/stainless-api/my-api/versions/1d73a351f557/schema)
