---
title: OpenAI Live | RunAPI
description: Send a request through RunAPI's OpenAI-compatible Live operation.
url: https://runapi.ai/it/docs/api/openai/live.md
canonical: https://runapi.ai/it/docs/api/openai/live
locale: it
---

> Versione HTML: https://runapi.ai/it/docs/api/openai/live
> Indice del sito per gli agenti: https://runapi.ai/llms.txt

# OpenAI Live

## Panoramica

Use RunAPI's OpenAI-compatible Live operation with a compatible model and the protocol's request and response shapes.

### Avvio rapido

1. Crea una Chiave API e impostala come RUNAPI_API_KEY.
2. Scegli un modello compatibile, quindi invia i parametri di percorso e il corpo JSON documentati.
3. Leggi la risposta JSON o gli eventi inviati dal server mostrati per questa operazione e gestisci gli errori di protocollo.

## Endpoint

POST /v1/live/webrtc

URL di base: https://runapi.ai

Versione del contratto: v1

Autenticazione preferita: Authorization: Bearer YOUR_API_TOKEN

## Vettori di autenticazione

RunAPI accetta ciascun protocollo elencato di seguito. I campioni generati utilizzano l'header preferito del protocollo.

- `Authorization: Bearer YOUR_API_TOKEN` (Preferito)
- `x-api-key: YOUR_API_TOKEN`

## Modelli compatibili

Apri la pagina di un modello per i prezzi correnti, i limiti di frequenza e i dettagli sull'uso commerciale.

- [gpt-live-1](https://runapi.ai/it/models/gpt)

## Contratto della richiesta

Sono elencati solo i campi con evidenza di supporto sia del protocollo pubblico che di RunAPI. I campi aggiuntivi del corpo JSON vengono trasmessi senza modifiche.

### Corpo JSON

Obbligatorio: `model`, `transport`, `sdp`

```json
{
  "delegation": {
    "additionalProperties": true,
    "description": "Optional client or Responses delegation contract.",
    "properties": {
      "instructions": {
        "description": "Backend prompt for delegated work when type is responses.",
        "type": "string"
      },
      "max_output_tokens": {
        "description": "Output token budget for the delegated response.",
        "type": "integer"
      },
      "model": {
        "description": "Responses model that runs delegated work when type is responses.",
        "minLength": 1,
        "type": "string"
      },
      "parallel_tool_calls": {
        "description": "Allow independent delegated tool calls in one turn.",
        "type": "boolean"
      },
      "reasoning": {
        "additionalProperties": true,
        "description": "Reasoning settings for the delegated model.",
        "type": "object"
      },
      "service_tier": {
        "description": "Service tier requested for the delegated response.",
        "type": "string"
      },
      "text": {
        "additionalProperties": true,
        "description": "Text output settings for the delegated response.",
        "type": "object"
      },
      "tool_choice": {
        "description": "Which delegated tools the backend may use.",
        "type": [
          "string",
          "object"
        ]
      },
      "tools": {
        "description": "Hosted Responses tools, or client-owned function tools when type is client.",
        "items": {
          "additionalProperties": true,
          "properties": {
            "type": {
              "type": "string"
            }
          },
          "required": [
            "type"
          ],
          "type": "object"
        },
        "minItems": 1,
        "type": "array"
      },
      "type": {
        "enum": [
          "client",
          "responses"
        ],
        "type": "string"
      }
    },
    "type": [
      "object",
      "null"
    ]
  },
  "model": {
    "description": "RunAPI model identifier; Live currently supports gpt-live-1.",
    "type": "string"
  },
  "sdp": {
    "description": "Client SDP offer for the WebRTC session.",
    "minLength": 1,
    "type": "string"
  },
  "transport": {
    "const": "webrtc",
    "description": "WebRTC session negotiation transport.",
    "type": "string"
  }
}
```

### Esempio di richiesta

```json
{
  "delegation": {
    "model": "gpt-5.6-terra",
    "tools": [
      {
        "type": "web_search_preview"
      }
    ],
    "type": "responses"
  },
  "model": "gpt-live-1",
  "sdp": "v=0",
  "transport": "webrtc"
}
```

## Risposta sincrona

HTTP 201

### Schema

```json
{
  "additionalProperties": true,
  "properties": {
    "session": {
      "additionalProperties": true,
      "type": "object"
    },
    "transport": {
      "additionalProperties": true,
      "type": "object"
    }
  },
  "required": [
    "session",
    "transport"
  ],
  "type": "object"
}
```

### Esempio

```json
{
  "session": {
    "id": "live_123"
  },
  "transport": {
    "sdp": "answer",
    "type": "webrtc"
  }
}
```

## Errore di protocollo: invalid_request

HTTP 400

### Schema

```json
{
  "additionalProperties": true,
  "properties": {
    "error": {
      "additionalProperties": true,
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "message": {
          "type": "string"
        },
        "param": {
          "type": [
            "string",
            "null"
          ]
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "message",
        "type"
      ],
      "type": "object"
    }
  },
  "required": [
    "error"
  ],
  "type": "object"
}
```

### Esempio

```json
{
  "error": {
    "code": null,
    "message": "Invalid Live session request",
    "param": "sdp",
    "type": "invalid_request_error"
  }
}
```

## Utilizzo

### Schema

```json
{
  "additionalProperties": true,
  "properties": {
    "duration_seconds": {
      "type": "number"
    }
  },
  "required": [
    "duration_seconds"
  ],
  "type": "object"
}
```

### Esempio

```json
{
  "duration_seconds": 3
}
```

## Esempi di Codice Generati

Ogni esempio cURL, JavaScript e Python invia la richiesta validata di questo contratto senza richiedere un SDK specifico per il protocollo.

### curl

```curl
curl -X POST https://runapi.ai/v1/live/webrtc \
  -H Authorization:\ Bearer\ YOUR_API_TOKEN \
  -H Content-Type:\ application/json \
  -d \{\"model\":\"gpt-live-1\",\"transport\":\"webrtc\",\"sdp\":\"v\=0\",\"delegation\":\{\"type\":\"responses\",\"model\":\"gpt-5.6-terra\",\"tools\":\[\{\"type\":\"web_search_preview\"\}\]\}\}
```

### javascript

```javascript
const response = await fetch("https://runapi.ai/v1/live/webrtc", {
  method: "POST",
  headers: {
  "Authorization": "Bearer YOUR_API_TOKEN",
  "Content-Type": "application/json"
},
  body: JSON.stringify({
  "model": "gpt-live-1",
  "transport": "webrtc",
  "sdp": "v=0",
  "delegation": {
    "type": "responses",
    "model": "gpt-5.6-terra",
    "tools": [
      {
        "type": "web_search_preview"
      }
    ]
  }
})
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();
console.log(data);
```

### python

#### Installa

```bash
pip install requests
```

```python
import requests

response = requests.post(
    "https://runapi.ai/v1/live/webrtc",
    headers={"Authorization": "Bearer YOUR_API_TOKEN", "Content-Type": "application/json"},
    json={"model": "gpt-live-1", "transport": "webrtc", "sdp": "v=0", "delegation": {"type": "responses", "model": "gpt-5.6-terra", "tools": [{"type": "web_search_preview"}]}}
)
response.raise_for_status()
print(response.json())
```

## Guide correlate

- [Autenticazione](https://runapi.ai/it/docs/guides/authentication.md)
- [Guida introduttiva](https://runapi.ai/it/docs/guides/llm-api/quickstart.md)

---

## Altre risorse di RunAPI

- [Home](https://runapi.ai/it/.md)
- [Catalogo dei modelli](https://runapi.ai/it/models.md)
- [Prezzi](https://runapi.ai/it/pricing.md)
- [Fornitori](https://runapi.ai/it/models)
- [Documentazione](https://runapi.ai/it/docs/guides)
- [SDK](https://runapi.ai/it/sdk.md)
- [CLI](https://runapi.ai/it/cli.md)
- [MCP Server](https://runapi.ai/it/mcp.md)
- [Claude Code vs Cursor](https://runapi.ai/it/claude-code-vs-cursor.md)
- [Configurazione Cursor API](https://runapi.ai/it/cursor-api-setup.md)
- [RunAPI vs OpenRouter](https://runapi.ai/it/openrouter-alternative.md)
- [Enterprise](https://runapi.ai/it/contact.md)
- [Contatti](https://runapi.ai/it/contact.md)
- [Termini](https://runapi.ai/it/terms.md)
- [Privacy](https://runapi.ai/it/privacy.md)
- [Indice del sito per gli agenti](https://runapi.ai/llms.txt)

Contatti: contact@runapi.ai

## Dati strutturati

```json
[
  {
    "@context": "https://schema.org",
    "inLanguage": "it",
    "@type": "WebSite",
    "name": "RunAPI",
    "url": "https://runapi.ai/it",
    "potentialAction": {
      "@type": "SearchAction",
      "target": {
        "@type": "EntryPoint",
        "urlTemplate": "https://runapi.ai/it/models?q={search_term_string}"
      },
      "query-input": "required name=search_term_string"
    }
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "it",
    "@type": "Organization",
    "name": "RunAPI",
    "url": "https://runapi.ai/it",
    "logo": {
      "@type": "ImageObject",
      "url": "https://runapi.ai/iticon.svg"
    },
    "sameAs": [
      "https://github.com/runapi-ai"
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "it",
    "@type": "TechArticle",
    "headline": "OpenAI Live",
    "description": "Send a request through RunAPI's OpenAI-compatible Live operation.",
    "url": "https://runapi.ai/it/docs/api/openai/live",
    "mainEntityOfPage": "https://runapi.ai/it/docs/api/openai/live"
  }
]
```
