# Depth Anything V2 API

> Monocular depth from one image: Depth Anything V2 Small (depth-anything/Depth-Anything-V2-Small-hf, Apache-2.0). Returns relative inverse depth (unit "relative_inverse", larger = closer), longest side ≤ 256.

## Details

- Model id: `bytedance/depth-anything-v2`
- Provider: HKU, TikTok
- Type: Perception · Depth
- Parameters: 24.8M (ViT-S)
- Output: Relative or metric depth map from one image
- Embodiments: Any (video)
- Endpoint: `POST /v1/depth`
- Price: $0.10 per 1,000 calls
- Checkpoint served: `depth-anything/Depth-Anything-V2-Small-hf`
- License: Apache-2.0
- Released: June 2024
- Status: Live
- Paper or model card: https://arxiv.org/abs/2406.09414

## Call Depth Anything V2

Send one request with your API key to `POST https://api.openrobotics.dev/v1/depth`. The response comes back in the same call. The [API reference](https://www.openrobotics.dev/docs/api/depth) lists every field. GPUs start on demand: after a quiet spell the first call returns `503` with `Retry-After` while one boots (never billed).

Python:

```python
import os, requests

res = requests.post(
  "https://api.openrobotics.dev/v1/depth",
  headers={"Authorization": f"Bearer {os.environ['OPENROBOTICS_API_KEY']}"},
  json={
    "model": "bytedance/depth-anything-v2",
    "image": "<base64 JPEG or PNG>",
  },
).json()
res["depth"]["data"]    # row-major depth map
```

TypeScript:

```typescript
const res = await fetch("https://api.openrobotics.dev/v1/depth", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.OPENROBOTICS_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    model: "bytedance/depth-anything-v2",
    image: "<base64 JPEG or PNG>",
  }),
}).then((r) => r.json());
```

cURL:

```bash
curl https://api.openrobotics.dev/v1/depth \
  -H "Authorization: Bearer $OPENROBOTICS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"bytedance/depth-anything-v2","image":"<base64 JPEG or PNG>"}'
```

## Guides about Depth Anything V2

- [Depth Anything V2 and 3: relative vs metric depth](https://www.openrobotics.dev/blog/depth-anything.md): Understand Depth Anything V2 and 3, relative versus metric depth, API output units, and a tested offline Python pinhole backprojection example.
- [Embodied AI: what it is, the model stack and benchmarks](https://www.openrobotics.dev/blog/embodied-ai.md): What embodied AI means, how it differs from physical AI, the models an embodied agent runs (perception to world models), key benchmarks and companies.
- [Physical AI explained: the open model stack for robots](https://www.openrobotics.dev/blog/physical-ai.md): What physical AI (embodied AI) means, the five kinds of models a robot uses, from perception to VLAs and world models, and open examples of each.
- [VGGT explained: feed-forward 3D reconstruction](https://www.openrobotics.dev/blog/vggt.md): How VGGT predicts cameras, depth, point maps and tracks in one pass, how it compares with DUSt3R, MASt3R, MapAnything and Depth Anything 3, and its API.

## Depth Anything V2 FAQ

### How do I run Depth Anything V2 without my own GPU?

Call POST /v1/depth on the OpenRobotics API with "model": "bytedance/depth-anything-v2". We run Depth Anything V2 on cloud GPUs that start on demand, so there is nothing to install or host.

### How much does the Depth Anything V2 API cost?

$0.10 per 1,000 calls, billed only for successful calls. Pay with prepaid credits or monthly pay-as-you-go.

### What license does Depth Anything V2 use?

The weights we serve (depth-anything/Depth-Anything-V2-Small-hf) are released under Apache-2.0. Check the license for your use case.

### Is Depth Anything V2 open source?

Depth Anything V2's weights are publicly available under Apache-2.0. OpenRobotics serves them behind an API so you can use the model without hosting it.

## Similar models

- [Depth Anything 3](https://www.openrobotics.dev/models/bytedance/depth-anything-3.md): `bytedance/depth-anything-3`, $0.10 per 1,000 calls
- [FoundationStereo](https://www.openrobotics.dev/models/nvidia/foundationstereo.md): `nvidia/foundationstereo`, $0.10 per 1,000 calls
- [MoGe-2](https://www.openrobotics.dev/models/microsoft/moge-2.md): `microsoft/moge-2`, $0.10 per 1,000 calls
- [Prompt Depth Anything](https://www.openrobotics.dev/models/bytedance/prompt-depth-anything.md): `bytedance/prompt-depth-anything`, $0.10 per 1,000 calls
- [Video Depth Anything](https://www.openrobotics.dev/models/bytedance/video-depth-anything.md): `bytedance/video-depth-anything`, $0.10 per 1,000 calls
- [Lotus (Depth G v2.1)](https://www.openrobotics.dev/models/hkust-gz/lotus.md): `hkust-gz/lotus`, $0.10 per 1,000 calls
