# Standardised REST API properties for structured outputs

**URL:** <https://discuss.huggingface.co/t/standardised-rest-api-properties-for-structured-outputs/165733>\
**Category:** Inference Endpoints on the Hub\
**Created:** [August 5, 2025, 2:05pm UTC](https://discuss.huggingface.co/t/standardised-rest-api-properties-for-structured-outputs/165733 "2025-08-05T14:05:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stevespencer](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/stevespencer/32/52139_2.png) [@stevespencer](https://discuss.huggingface.co/u/stevespencer)\
**Post date:** [August 5, 2025, 2:05pm UTC](https://discuss.huggingface.co/t/standardised-rest-api-properties-for-structured-outputs/165733/1 "2025-08-05T14:05:03Z")

</div>

I’m exploring adding HuggingFace support to my app so my clients can use their own HuggingFace account to use serverless inference endpoints for text generation.

Our app uses the REST API directly and we need to be able to use Chat Completions with JSON Schema based structured outputs (or GBNF grammars, although I suspect that is too specialist).

However when speaking to Nebius it seems that I can only use this when connecting directly to them via a “guided\_json” proprietary property in the JSON data POSTed to the chat completions REST API endpoint. It’s unclear whether I can use this when accessing via HuggingFace and using the HF routing. There does not appear to be any documentation on HF regarding cURL access (for example) with structured outputs. There doesn’t appear to be a standard. I’d expect structured outputs to follow the OpenAI Chat Completions specification, which is not “guided\_json”, in any kind of HF-presented standardised API.

What’s the guidance, if I wish to use JSON Schema structured outputs with HF routed chat completions?

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [August 6, 2025, 9:55am UTC](https://discuss.huggingface.co/t/standardised-rest-api-properties-for-structured-outputs/165733/2 "2025-08-06T09:55:06Z")

</div>

[`response_format` argument](https://huggingface.co/docs/inference-providers/en/guides/structured-output) might be useful.

---

<div class="post-metadata">

**Author:** ![stevespencer](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/stevespencer/32/52139_2.png) [@stevespencer](https://discuss.huggingface.co/u/stevespencer)\
**Post date:** [August 6, 2025, 12:31pm UTC](https://discuss.huggingface.co/t/standardised-rest-api-properties-for-structured-outputs/165733/3 "2025-08-06T12:31:51Z")

</div>

Yes, clearly using the OpenAI assumed standard for (albeit deprecated) Chat Completions of response\_format is the way to go:

```json
"response_format": {
      "type": "json_schema",
      "json_schema": { ... }
}

```

Note that nebius appear to support `response_format for json mode (arbitrary json, as per OpenAI, below) but use different `guided\_json` for structured.

```json
"response_format": { 
    "type": "json_object" 
}

```
