# D-FINE API

> Real-time DETR that redefines box regression as fine-grained distribution refinement with self-distillation; X model reaches ~59 AP on COCO with Objects365 pretraining.

## Details

- Model id: `ustc/d-fine`
- Provider: USTC
- Type: Perception · Detection
- Parameters: 62M (X)
- Output: Closed-set real-time boxes (COCO 80 / Objects365 classes)
- Embodiments: Any (video), Mobile manipulator, Autonomous vehicle, Drone
- Endpoint: `POST /v1/detect`
- Price: $0.10 per 1,000 calls
- Checkpoint served: `ustc-community/dfine-xlarge-obj2coco`
- License: Apache-2.0 (HGNetv2 backbone, trained from scratch on Objects365/COCO)
- Released: March 2025
- Status: Live
- Paper or model card: https://arxiv.org/abs/2410.13842

## Inputs

What a request to D-FINE needs beyond the endpoint's generic fields (also in `GET https://api.openrobotics.dev/v1/models/ustc/d-fine` as `inputs`).

- Notes: Closed set: each label is matched to one of the detector's fixed classes (e.g. COCO's 80), case-insensitively, exactly or by containment; labels that match none are ignored.

## Call D-FINE

Send one request with your API key to `POST https://api.openrobotics.dev/v1/detect`. The response comes back in the same call. The [API reference](https://www.openrobotics.dev/docs/api/detect) 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/detect",
  headers={"Authorization": f"Bearer {os.environ['OPENROBOTICS_API_KEY']}"},
  json={
    "model": "ustc/d-fine",
    "image": "<base64 JPEG or PNG>",
    "labels": ["cup", "bowl"],
  },
).json()
res["detections"]       # label, score, box
```

TypeScript:

```typescript
const res = await fetch("https://api.openrobotics.dev/v1/detect", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.OPENROBOTICS_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    model: "ustc/d-fine",
    image: "<base64 JPEG or PNG>",
    labels: ["cup", "bowl"],
  }),
}).then((r) => r.json());
```

cURL:

```bash
curl https://api.openrobotics.dev/v1/detect \
  -H "Authorization: Bearer $OPENROBOTICS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"ustc/d-fine","image":"<base64 JPEG or PNG>","labels":["cup","bowl"]}'
```

## Guides about D-FINE

- [Object detection models: RF-DETR vs Grounding DINO and more](https://www.openrobotics.dev/blog/object-detection-models.md): Compare real-time detectors (RF-DETR, D-FINE) with open-vocabulary ones (Grounding DINO, OWLv2, Florence-2, YOLO-World): licenses, sizes and when to use each.
- [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.

## D-FINE FAQ

### How do I run D-FINE without my own GPU?

Call POST /v1/detect on the OpenRobotics API with "model": "ustc/d-fine". We run D-FINE on cloud GPUs that start on demand, so there is nothing to install or host.

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

The weights we serve (ustc-community/dfine-xlarge-obj2coco) are released under Apache-2.0 (HGNetv2 backbone, trained from scratch on Objects365/COCO). Check the license for your use case.

### Is D-FINE open source?

D-FINE's weights are publicly available under Apache-2.0 (HGNetv2 backbone, trained from scratch on Objects365/COCO). OpenRobotics serves them behind an API so you can use the model without hosting it.

## Similar models

- [Grounding DINO](https://www.openrobotics.dev/models/idea-research/grounding-dino.md): `idea-research/grounding-dino`, $0.10 per 1,000 calls
- [OWLv2](https://www.openrobotics.dev/models/google/owlv2.md): `google/owlv2`, $0.10 per 1,000 calls
- [Florence-2](https://www.openrobotics.dev/models/microsoft/florence-2.md): `microsoft/florence-2`, $0.10 per 1,000 calls
- [RF-DETR](https://www.openrobotics.dev/models/roboflow/rf-detr.md): `roboflow/rf-detr`, $0.10 per 1,000 calls
- [LLMDet](https://www.openrobotics.dev/models/isee/llmdet.md): `isee/llmdet`, $0.10 per 1,000 calls
- [OmDet-Turbo](https://www.openrobotics.dev/models/omlab/omdet-turbo.md): `omlab/omdet-turbo`, $0.10 per 1,000 calls
