Skip to main content

Overview

Repositories are the top-level containers for your AI projects. Each repository has a base model configuration and contains prompts, targets, and bakes.

Endpoints

List Repositories

List all repositories visible to your team. Endpoint: GET /v1/repo
SDK Usage:
  • TypeScript: client.repo.list() supports include_metadata, offset, and limit parameters (check SDK for latest support)
  • Python: client.repo.list() supports include_metadata, offset, and limit parameters (check SDK for latest support)
See SDK Quickstart for examples.
Request (default - simple list):
curl -X GET "https://bapi.bread.com.ai/v1/repo" \
  -H "Authorization: Bearer $BREAD_API_KEY"
Response: 200 OK
{
  "repos": ["my_repo", "another_repo", "project_v1"]
}
Request (with metadata):
curl -X GET "https://bapi.bread.com.ai/v1/repo?include_metadata=true" \
  -H "Authorization: Bearer $BREAD_API_KEY"
Response: 200 OK
{
  "repos": [
    {"repo_name": "my_repo", "base_model": "Qwen/Qwen3-32B"},
    {"repo_name": "another_repo", "base_model": "Qwen/Qwen3-32B"},
    {"repo_name": "project_v1", "base_model": "meta-llama/Llama-3.1-8B"}
  ],
  "offset": 0,
  "limit": 50,
  "has_more": false,
  "total": 3
}
Query Parameters:
include_metadata
boolean
Include base_model metadata for each repository. Default: falseWhen true, returns PaginatedRepoList with metadata. When false, returns simple RepoList (backward compatible).
offset
integer
Starting offset for pagination. Only used when include_metadata=true. Default: 0
limit
integer
Page size for pagination. Only used when include_metadata=true. Default: all repositories
Response Fields (simple list):
  • repos: Array<string> - List of repository names
Response Fields (with metadata):
  • repos: Array<RepoItem> - List of repositories with metadata
    • repo_name: string - Repository name
    • base_model: string - Base model identifier
  • offset: number - Starting offset
  • limit: number - Page size
  • has_more: boolean - Whether more repositories are available
  • total: number | null - Total number of repositories (if available)

Get Repository

Get repository configuration and metadata. Endpoint: GET /v1/repo/{repo_name} Request:
curl -X GET "https://bapi.bread.com.ai/v1/repo/my_repo" \
  -H "Authorization: Bearer $BREAD_API_KEY"
repo_name
string
required
Repository name to retrieve
Response: 200 OK
{
  "repo_name": "my_repo",
  "base_model": "Qwen/Qwen3-32B"
}
Response Fields:
  • repo_name: string - Repository name
  • base_model: string - Base model identifier

Create or Update Repository

Create or update a repository. This operation is idempotent. Endpoint: POST /v1/repo Request:
curl -X POST "https://bapi.bread.com.ai/v1/repo" \
  -H "Authorization: Bearer $BREAD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "repo_name": "my_repo",
    "base_model": "Qwen/Qwen3-32B"
  }'
repo_name
string
required
Name of the repository
base_model
string
Base model for the repository (e.g., “Qwen/Qwen3-32B”)
The base_model cannot be changed after initial creation. Attempting to modify it will return a 409 Conflict error.
Response: 200 OK
{
  "repo_name": "my_repo",
  "base_model": "Qwen/Qwen3-32B"
}

Create or Update Repository (Deprecated)

Deprecated: Use POST /v1/repo instead. This endpoint will be removed in a future version.
Endpoint: PUT /v1/repo Request:
curl -X PUT "https://bapi.bread.com.ai/v1/repo" \
  -H "Authorization: Bearer $BREAD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "repo_name": "my_repo",
    "base_model": "Qwen/Qwen3-32B"
  }'

Examples

Create Repository with Base Model

curl -X POST "https://bapi.bread.com.ai/v1/repo" \
  -H "Authorization: Bearer $BREAD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "repo_name": "coding_project",
    "base_model": "Qwen/Qwen3-32B"
  }'

Check if Repository Exists

# Get repository (returns 404 if not found)
curl -X GET "https://bapi.bread.com.ai/v1/repo/my_repo" \
  -H "Authorization: Bearer $BREAD_API_KEY"

# If 404, create it
curl -X POST "https://bapi.bread.com.ai/v1/repo" \
  -H "Authorization: Bearer $BREAD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "repo_name": "my_repo"
  }'

List All Repositories

curl -X GET "https://bapi.bread.com.ai/v1/repo" \
  -H "Authorization: Bearer $BREAD_API_KEY"

Error Handling

Conflict Error (409)

Attempting to change base_model of an existing repository:
curl -X POST "https://bapi.bread.com.ai/v1/repo" \
  -H "Authorization: Bearer $BREAD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "repo_name": "existing_repo",
    "base_model": "different_model"
  }'
Response: 409 Conflict
{
  "error": "Cannot change base_model of existing repository"
}

Not Found Error (404)

Getting a non-existent repository:
curl -X GET "https://bapi.bread.com.ai/v1/repo/nonexistent_repo" \
  -H "Authorization: Bearer $BREAD_API_KEY"
Response: 404 Not Found
{
  "error": "Repository not found"
}

Response Types

RepoResponse

{
  "repo_name": "string",
  "base_model": "string"
}

RepoListResponse

{
  "repos": ["string"]
}

PaginatedRepoList

{
  "repos": [
    {
      "repo_name": "string",
      "base_model": "string"
    }
  ],
  "offset": 0,
  "limit": 50,
  "has_more": false,
  "total": 1
}

Best Practices

The base_model cannot be changed after creation. Choose carefully based on your use case and model requirements.
Repository names should be descriptive and follow a consistent naming convention (e.g., project_name, team_experiment_v1).
Use get() to check if a repository exists before creating it, or rely on POST /v1/repo’s idempotent behavior.

Next Steps