# FoundationPose API

> Unified model for 6D pose estimation and tracking of novel objects, from a CAD model or a few reference images, with no fine-tuning. CVPR 2024 highlight, widely used in manipulation.

## Details

- Model id: `nvidia/foundationpose`
- Provider: NVIDIA
- Type: Perception · 6D pose
- Output: 6D object pose estimation and tracking from RGB-D
- Embodiments: Any (video)
- Endpoint: `POST /v1/pose`
- Price: $0.10 per 1,000 calls
- Checkpoint served: `nvidia/foundationpose`
- License: NVIDIA Open Model License (refiner_net.onnx + score_net.onnx, hf.co/nvidia/foundationpose); NVlabs/FoundationPose code and nvdiffrast: NVIDIA non-commercial source licenses, not used
- Released: December 2023
- Status: Live
- Paper or model card: https://arxiv.org/abs/2312.08344

## Inputs

What a request to FoundationPose needs beyond the endpoint's generic fields (also in `GET https://api.openrobotics.dev/v1/models/nvidia/foundationpose` as `inputs`).

- `depth` (required): Metric depth of the image: 16-bit PNG in millimetres, the image's size.
- `intrinsics` (required): [fx, fy, cx, cy] in pixels of the image.
- `meshes` (required): The CAD model (ply or obj) of each object, by object name.
- `boxes` (required): Where each object is in the image, [x0, y0, x1, y1] by object name (e.g. from /v1/detect).

## Call FoundationPose

Send one request with your API key to `POST https://api.openrobotics.dev/v1/pose`. The response comes back in the same call. The [API reference](https://www.openrobotics.dev/docs/api/pose) 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/pose",
  headers={"Authorization": f"Bearer {os.environ['OPENROBOTICS_API_KEY']}"},
  json={
    "model": "nvidia/foundationpose",
    "image": "<base64 JPEG or PNG>",
    "object": "mug",
    "depth": "<…>",  # Metric depth of the image: 16-bit PNG in millimetres, the image's size.
    "intrinsics": "<…>",  # [fx, fy, cx, cy] in pixels of the image.
    "meshes": "<…>",  # The CAD model (ply or obj) of each object, by object name.
    "boxes": "<…>",  # Where each object is in the image, [x0, y0, x1, y1] by object name (e.g. from /v1/detect).
  },
).json()
res["poses"]           # translation (m) + rotation quaternion
```

TypeScript:

```typescript
const res = await fetch("https://api.openrobotics.dev/v1/pose", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.OPENROBOTICS_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    model: "nvidia/foundationpose",
    image: "<base64 JPEG or PNG>",
    object: "mug",
    depth: "<…>",  // Metric depth of the image: 16-bit PNG in millimetres, the image's size.
    intrinsics: "<…>",  // [fx, fy, cx, cy] in pixels of the image.
    meshes: "<…>",  // The CAD model (ply or obj) of each object, by object name.
    boxes: "<…>",  // Where each object is in the image, [x0, y0, x1, y1] by object name (e.g. from /v1/detect).
  }),
}).then((r) => r.json());
```

cURL:

```bash
curl https://api.openrobotics.dev/v1/pose \
  -H "Authorization: Bearer $OPENROBOTICS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"nvidia/foundationpose","image":"<base64 JPEG or PNG>","object":"mug","depth":"<…>","intrinsics":"<…>","meshes":"<…>","boxes":"<…>"}'
```

## Guides about FoundationPose

- [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.

## FoundationPose FAQ

### How do I run FoundationPose without my own GPU?

Call POST /v1/pose on the OpenRobotics API with "model": "nvidia/foundationpose". We run FoundationPose on cloud GPUs that start on demand, so there is nothing to install or host.

### How much does the FoundationPose 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 FoundationPose use?

The weights we serve (nvidia/foundationpose) are released under NVIDIA Open Model License (refiner_net.onnx + score_net.onnx, hf.co/nvidia/foundationpose); NVlabs/FoundationPose code and nvdiffrast: NVIDIA non-commercial source licenses, not used. Check the license for your use case.

### Is FoundationPose open source?

FoundationPose's weights are publicly available under NVIDIA Open Model License (refiner_net.onnx + score_net.onnx, hf.co/nvidia/foundationpose); NVlabs/FoundationPose code and nvdiffrast: NVIDIA non-commercial source licenses, not used. OpenRobotics serves them behind an API so you can use the model without hosting it.

## Similar models

- [MegaPose](https://www.openrobotics.dev/models/inria/megapose.md): `inria/megapose`, coming soon
- [Any6D](https://www.openrobotics.dev/models/kaist/any6d.md): `kaist/any6d`, not served
- [SAM 2](https://www.openrobotics.dev/models/meta/sam-2.md): `meta/sam-2`, $0.10 per 1,000 calls
- [SAM 3](https://www.openrobotics.dev/models/meta/sam-3.md): `meta/sam-3`, $0.10 per 1,000 calls
- [Segment Anything (SAM)](https://www.openrobotics.dev/models/meta/sam.md): `meta/sam`, $0.10 per 1,000 calls
- [Grounded SAM 2](https://www.openrobotics.dev/models/idea-research/grounded-sam-2.md): `idea-research/grounded-sam-2`, $0.10 per 1,000 calls
