---
title: "Import From Github"
method: POST
path: "/v1/datasets/import-from-github"
tags: ["datasets"]
---

# Import From Github

`POST /v1/datasets/import-from-github`

## Request

- Base URL: `https://api.pioneer.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.pioneer.ai/v1/datasets/import-from-github`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/pioneer/apis/brain-api/docs/v1/datasets/import-from-github/post.ts> (a function with typed inputs; its response is checked against the schema)

Download a file from GitHub and create a Fastino dataset.

Args:
    request: Repo, file path, and optional branch, dataset name, GitHub
        token, and dataset purpose (``type``: 'training' (default),
        'evaluation', or 'benchmark' -- 'benchmark' is rejected,
        mirroring ``pull_dataset_from_hub``).
    http_request: Raw request, read only to identify sandbox run keys.
    auth: Authenticated user context.

Returns:
    DatasetResponse of the created dataset.

Raises:
    HTTPException: 400 on parse errors, 403 on a run-key token or
        ``type='benchmark'``, 502 on download failures.

## Request body

- GithubImportRequest: Request to import a single data file from a GitHub repository.
  - `repo` string, required: GitHub repository, e.g. 'owner/repo' or a full URL
  - `file_path` string, required: Path to the data file inside the repository
  - `branch` string, nullable: Branch or ref to import from. Defaults to the default branch
  - `dataset_name` string, nullable: Name for the new Fastino dataset. Defaults to a slugified file base name
  - `github_token` string, nullable: GitHub personal access token for private repos or higher rate limits. Sandbox run keys must omit this field and can only import public repos.
  - `type` 'training' | 'evaluation' | 'benchmark', nullable: Dataset purpose: 'training' (trainable), 'evaluation' (not trainable), 'benchmark' (system-managed, evaluation-only; cannot be created via this endpoint).

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

## Changes

- **2026-09-24** `0e5e86e2bae5`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/pioneer/apis/brain-api/changes/v1/datasets/import-from-github/post.md)

---

[API](https://skmtc.dev/pioneer/apis/brain-api.md) - [All operations](https://skmtc.dev/pioneer/apis/brain-api/llms.txt) - [OpenAPI document](https://skmtc.dev/pioneer/apis/brain-api/revisions/0e5e86e2bae5?raw)
