# \RealtimeApi
All URIs are relative to *https://api.openai.com/v1*
Method | HTTP request | Description
------------- | ------------- | -------------
[**accept_realtime_call**](RealtimeApi.md#accept_realtime_call) | **POST** /realtime/calls/{call_id}/accept | Accept an incoming SIP call and configure the realtime session that will handle it.
[**create_realtime_call**](RealtimeApi.md#create_realtime_call) | **POST** /realtime/calls | Create a new Realtime API call over WebRTC and receive the SDP answer needed to complete the peer connection.
[**create_realtime_client_secret**](RealtimeApi.md#create_realtime_client_secret) | **POST** /realtime/client_secrets | Create a Realtime client secret with an associated session configuration. Client secrets are short-lived tokens that can be passed to a client app, such as a web frontend or mobile client, which grants access to the Realtime API without leaking your main API key. You can configure a custom TTL for each client secret. You can also attach session configuration options to the client secret, which will be applied to any sessions created using that client secret, but these can also be overridden by the client connection. [Learn more about authentication with client secrets over WebRTC](/docs/guides/realtime-webrtc). Returns the created client secret and the effective session object. The client secret is a string that looks like `ek_1234`.
[**create_realtime_session**](RealtimeApi.md#create_realtime_session) | **POST** /realtime/sessions | Create an ephemeral API token for use in client-side applications with the Realtime API. Can be configured with the same session parameters as the `session.update` client event. It responds with a session object, plus a `client_secret` key which contains a usable ephemeral API token that can be used to authenticate browser clients for the Realtime API. Returns the created Realtime session object, plus an ephemeral key.
[**create_realtime_transcription_session**](RealtimeApi.md#create_realtime_transcription_session) | **POST** /realtime/transcription_sessions | Create an ephemeral API token for use in client-side applications with the Realtime API specifically for realtime transcriptions. Can be configured with the same session parameters as the `transcription_session.update` client event. It responds with a session object, plus a `client_secret` key which contains a usable ephemeral API token that can be used to authenticate browser clients for the Realtime API. Returns the created Realtime transcription session object, plus an ephemeral key.
[**hangup_realtime_call**](RealtimeApi.md#hangup_realtime_call) | **POST** /realtime/calls/{call_id}/hangup | End an active Realtime API call, whether it was initiated over SIP or WebRTC.
[**refer_realtime_call**](RealtimeApi.md#refer_realtime_call) | **POST** /realtime/calls/{call_id}/refer | Transfer an active SIP call to a new destination using the SIP REFER verb.
[**reject_realtime_call**](RealtimeApi.md#reject_realtime_call) | **POST** /realtime/calls/{call_id}/reject | Decline an incoming SIP call by returning a SIP status code to the caller.
## accept_realtime_call
> accept_realtime_call(call_id, realtime_session_create_request_ga)
Accept an incoming SIP call and configure the realtime session that will handle it.
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**call_id** | **String** | The identifier for the call provided in the [`realtime.call.incoming`](/docs/api-reference/webhook-events/realtime/call/incoming) webhook. | [required] |
**realtime_session_create_request_ga** | [**RealtimeSessionCreateRequestGa**](RealtimeSessionCreateRequestGa.md) | Session configuration to apply before the caller is bridged to the model. | [required] |
### Return type
(empty response body)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## create_realtime_call
> String create_realtime_call(sdp, session)
Create a new Realtime API call over WebRTC and receive the SDP answer needed to complete the peer connection.
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**sdp** | **String** | WebRTC Session Description Protocol (SDP) offer generated by the caller. | [required] |
**session** | Option<[**models::RealtimeSessionCreateRequestGa**](RealtimeSessionCreateRequestGA.md)> | Optional session configuration to apply before the realtime session is created. Use the same parameters you would send in a [`create client secret`](/docs/api-reference/realtime-sessions/create-realtime-client-secret) request. | |
### Return type
**String**
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: multipart/form-data, application/sdp
- **Accept**: application/sdp
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## create_realtime_client_secret
> models::RealtimeCreateClientSecretResponse create_realtime_client_secret(realtime_create_client_secret_request)
Create a Realtime client secret with an associated session configuration. Client secrets are short-lived tokens that can be passed to a client app, such as a web frontend or mobile client, which grants access to the Realtime API without leaking your main API key. You can configure a custom TTL for each client secret. You can also attach session configuration options to the client secret, which will be applied to any sessions created using that client secret, but these can also be overridden by the client connection. [Learn more about authentication with client secrets over WebRTC](/docs/guides/realtime-webrtc). Returns the created client secret and the effective session object. The client secret is a string that looks like `ek_1234`.
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**realtime_create_client_secret_request** | [**RealtimeCreateClientSecretRequest**](RealtimeCreateClientSecretRequest.md) | Create a client secret with the given session configuration. | [required] |
### Return type
[**models::RealtimeCreateClientSecretResponse**](RealtimeCreateClientSecretResponse.md)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## create_realtime_session
> models::RealtimeSessionCreateResponse create_realtime_session(realtime_session_create_request)
Create an ephemeral API token for use in client-side applications with the Realtime API. Can be configured with the same session parameters as the `session.update` client event. It responds with a session object, plus a `client_secret` key which contains a usable ephemeral API token that can be used to authenticate browser clients for the Realtime API. Returns the created Realtime session object, plus an ephemeral key.
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**realtime_session_create_request** | [**RealtimeSessionCreateRequest**](RealtimeSessionCreateRequest.md) | Create an ephemeral API key with the given session configuration. | [required] |
### Return type
[**models::RealtimeSessionCreateResponse**](RealtimeSessionCreateResponse.md)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## create_realtime_transcription_session
> models::RealtimeTranscriptionSessionCreateResponse create_realtime_transcription_session(realtime_transcription_session_create_request)
Create an ephemeral API token for use in client-side applications with the Realtime API specifically for realtime transcriptions. Can be configured with the same session parameters as the `transcription_session.update` client event. It responds with a session object, plus a `client_secret` key which contains a usable ephemeral API token that can be used to authenticate browser clients for the Realtime API. Returns the created Realtime transcription session object, plus an ephemeral key.
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**realtime_transcription_session_create_request** | [**RealtimeTranscriptionSessionCreateRequest**](RealtimeTranscriptionSessionCreateRequest.md) | Create an ephemeral API key with the given session configuration. | [required] |
### Return type
[**models::RealtimeTranscriptionSessionCreateResponse**](RealtimeTranscriptionSessionCreateResponse.md)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## hangup_realtime_call
> hangup_realtime_call(call_id)
End an active Realtime API call, whether it was initiated over SIP or WebRTC.
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**call_id** | **String** | The identifier for the call. For SIP calls, use the value provided in the [`realtime.call.incoming`](/docs/api-reference/webhook-events/realtime/call/incoming) webhook. For WebRTC sessions, reuse the call ID returned in the `Location` header when creating the call with [`POST /v1/realtime/calls`](/docs/api-reference/realtime/create-call). | [required] |
### Return type
(empty response body)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## refer_realtime_call
> refer_realtime_call(call_id, realtime_call_refer_request)
Transfer an active SIP call to a new destination using the SIP REFER verb.
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**call_id** | **String** | The identifier for the call provided in the [`realtime.call.incoming`](/docs/api-reference/webhook-events/realtime/call/incoming) webhook. | [required] |
**realtime_call_refer_request** | [**RealtimeCallReferRequest**](RealtimeCallReferRequest.md) | Destination URI for the REFER request. | [required] |
### Return type
(empty response body)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## reject_realtime_call
> reject_realtime_call(call_id, realtime_call_reject_request)
Decline an incoming SIP call by returning a SIP status code to the caller.
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**call_id** | **String** | The identifier for the call provided in the [`realtime.call.incoming`](/docs/api-reference/webhook-events/realtime/call/incoming) webhook. | [required] |
**realtime_call_reject_request** | Option<[**RealtimeCallRejectRequest**](RealtimeCallRejectRequest.md)> | Provide an optional SIP status code. When omitted the API responds with `603 Decline`. | |
### Return type
(empty response body)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)