Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing to access "gpt-4o-realtime-preview-2024-12-17" model #28

Open
seratch opened this issue Feb 19, 2025 · 0 comments
Open

Failing to access "gpt-4o-realtime-preview-2024-12-17" model #28

seratch opened this issue Feb 19, 2025 · 0 comments

Comments

@seratch
Copy link
Member

seratch commented Feb 19, 2025

Hello! It seems my account can't access the gpt-4o-realtime-preview-2024-12-17 model, but it can use the gpt-4o-realtime-preview. Should this example app consistently use the gpt-4o-realtime-preview to ensure broader audiences can run it successfully?

Here is the error response with gpt-4o-realtime-preview-2024-12-17 model:

{
  "type": "response.done",
  "event_id": "event_XXX",
  "response": {
    "object": "realtime.response",
    "id": "resp_XXX",
    "status": "failed",
    "status_details": {
      "type": "failed",
      "error": {
        "type": "invalid_request_error",
        "code": "model_not_found",
        "message": "The model `gpt-4o-realtime-preview-2024-12-17` does not exist or you do not have access to it."
      }
    },
    "output": [],
    "conversation_id": "conv_XXX",
    "modalities": [
      "audio",
      "text"
    ],
    "voice": "coral",
    "output_audio_format": "pcm16",
    "temperature": 0.8,
    "max_output_tokens": "inf",
    "usage": {
      "total_tokens": 0,
      "input_tokens": 0,
      "output_tokens": 0,
      "input_token_details": {
        "text_tokens": 0,
        "audio_tokens": 0,
        "cached_tokens": 0,
        "cached_tokens_details": {
          "text_tokens": 0,
          "audio_tokens": 0
        }
      },
      "output_token_details": {
        "text_tokens": 0,
        "audio_tokens": 0
      }
    },
    "metadata": null
  }
}

Modifying the code this way resolved the issue for me:

diff --git a/src/app/api/session/route.ts b/src/app/api/session/route.ts
index 9f1d9bc..d92f37b 100644
--- a/src/app/api/session/route.ts
+++ b/src/app/api/session/route.ts
@@ -11,7 +11,7 @@ export async function GET() {
           "Content-Type": "application/json",
         },
         body: JSON.stringify({
-          model: "gpt-4o-realtime-preview-2024-12-17",
+          model: "gpt-4o-realtime-preview",
         }),
       }
     );
diff --git a/src/app/lib/realtimeConnection.ts b/src/app/lib/realtimeConnection.ts
index df0a5e2..8549e49 100644
--- a/src/app/lib/realtimeConnection.ts
+++ b/src/app/lib/realtimeConnection.ts
@@ -21,7 +21,7 @@ export async function createRealtimeConnection(
   await pc.setLocalDescription(offer);
 
   const baseUrl = "https://api.openai.com/v1/realtime";
-  const model = "gpt-4o-realtime-preview-2024-12-17";
+  const model = "gpt-4o-realtime-preview";
 
   const sdpResponse = await fetch(`${baseUrl}?model=${model}`, {
     method: "POST",

I am happy to send a pull request as necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant