# Replicate

> **You are on:** `https://beta-api.paywithlocus.com/api` | [llms.txt](https://beta.paywithlocus.com/llms.txt)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API |
> |---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com |
> | Beta | beta.paywithlocus.com | beta-api.paywithlocus.com |
> | Stage | stage.paywithlocus.com | stage-api.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Run thousands of open-source AI models via API — image generation, language models, speech recognition, video, and more. Pay only for what you use.

**Category:** AI / Generative | **Website:** [replicate.com](https://replicate.com) | **Docs:** [replicate.com/docs/reference/http](https://replicate.com/docs/reference/http)

## Access Methods

| Method | Base URL | Auth |
|--------|----------|------|
| **MPP (Tempo)** | `https://replicate.mpp.paywithlocus.com/replicate/` | HTTP 402 auto-payment |
| **Wrapped API** | `https://beta-api.paywithlocus.com/api/wrapped/replicate/` | `Authorization: Bearer <LOCUS_API_KEY>` |

**OpenAPI discovery:** `GET https://replicate.mpp.paywithlocus.com/openapi.json`

## Endpoints

### Run Model

Run any public Replicate model synchronously. The request blocks until the prediction completes (up to 60 seconds). Returns output directly in the response. If the model takes longer than 60s the response will include a prediction ID you can check with get-prediction.

**Estimated cost:** Model-dependent ($0.005–$0.05)

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `model_owner` | string | Yes | Model owner / namespace (e.g. 'black-forest-labs') |
| `model_name` | string | Yes | Model name (e.g. 'flux-schnell') |
| `input` | object | No | Model input parameters as an object (e.g. { prompt: 'a cat' }). Schema varies per model — see model page on replicate.com. |

```bash
curl -X POST https://replicate.mpp.paywithlocus.com/replicate/run \
  -H "Content-Type: application/json" \
  -d '{"model_owner":"<string>","model_name":"<string>","input":"<object>"}'
```

### Get Prediction

Retrieve the status and output of a prediction by ID. Free — use this to check results for models that exceeded the 60s synchronous timeout in the run endpoint.

**Estimated cost:** Free

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `prediction_id` | string | Yes | Prediction ID returned by the run endpoint |

```bash
curl -X POST https://replicate.mpp.paywithlocus.com/replicate/get-prediction \
  -H "Content-Type: application/json" \
  -d '{"prediction_id":"<string>"}'
```

### Get Model

Retrieve metadata for a public Replicate model: description, hardware, latest version, run count, and links.

**Estimated cost:** $0.001 + $0.003 fee

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `model_owner` | string | Yes | Model owner / namespace (e.g. 'black-forest-labs') |
| `model_name` | string | Yes | Model name (e.g. 'flux-schnell') |

```bash
curl -X POST https://replicate.mpp.paywithlocus.com/replicate/get-model \
  -H "Content-Type: application/json" \
  -d '{"model_owner":"<string>","model_name":"<string>"}'
```

### List Models

Browse public Replicate models. Returns a paginated list with metadata. Use the cursor field for pagination.

**Estimated cost:** $0.001 + $0.003 fee

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `cursor` | string | No | Pagination cursor from a previous list-models response |

```bash
curl -X POST https://replicate.mpp.paywithlocus.com/replicate/list-models \
  -H "Content-Type: application/json" \
  -d '{"cursor":"<string>"}'
```
