MCPcopy
hub / github.com/openai/openai-fm

github.com/openai/openai-fm @main sqlite

repository ↗ · DeepWiki ↗
79 symbols 151 edges 35 files 0 documented · 0%
README

OpenAI.fm

MIT License NextJS OpenAI API

OpenAI.fm is an interactive demo to showcase the new OpenAI text-to-speech models. It is built with NextJS and the Speech API.

For more information about text-to-speech using the OpenAI API, check out our documentation.

screenshot

How to run

  1. Set up the OpenAI API:

  2. If you're new to the OpenAI API, sign up for an account.

  3. Follow the Quickstart to retrieve your API key.

  4. Clone the Repository:

bash git clone https://github.com/openai/openai-fm.git

  1. Set the OpenAI API key:

2 options:

  • Set the OPENAI_API_KEY environment variable globally in your system
  • Set the OPENAI_API_KEY environment variable in the project: Create a .env file at the root of the project and add the following line (see .env.example for reference):

bash OPENAI_API_KEY=<your_api_key>

  1. Install dependencies:

Run in the project root:

bash npm install

  1. (Optional) Connect to a hosted database:

If you want to use the sharing feature, you need to connect to a hosted postgres database. You should set the environment variables in a .env file at the root of the project to connect to your database as shown in .env.example.

bash POSTGRES_URL="postgresql://username:password@host:port/database_name"

This step is not needed to run the application and only affects the sharing feature.

  1. Run the app:

bash npm run dev

The app will be available at http://localhost:3000.

[!NOTE]
Be aware that if you deploy this app to a public server, you are responsible for any usage it may incur using your OpenAI API key.

Contributors

OpenAI team

Contributing

You are welcome to open issues or submit PRs to improve this app, however, please note that we may not review all suggestions.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Extension points exported contracts — how you extend this code

ButtonBaseProps (Interface)
(no doc)
src/components/ui/Button.tsx
AppState (Interface)
(no doc)
src/lib/store.ts
SWMessage (Interface)
(no doc)
src/hooks/useServiceWorker.ts
HeaderProps (Interface)
(no doc)
src/components/ui/Header.tsx
LibraryEntry (Interface)
(no doc)
src/lib/types.ts
SwitcherProps (Interface)
(no doc)
src/components/ui/Switcher.tsx
BlockProps (Interface)
(no doc)
src/components/ui/Block.tsx
TabChildProps (Interface)
(no doc)
src/components/ui/Block.tsx

Core symbols most depended-on inside this repo

getCodeSnippet
called by 4
src/lib/codeSnippet.ts
copyText
called by 3
src/lib/copyText.ts
useAudioClip
called by 3
src/hooks/useAudioClip.tsx
getRandomLibrarySet
called by 2
src/lib/library.ts
useCopiedDelay
called by 2
src/hooks/useCopiedDelay.tsx
trigger
called by 2
src/hooks/useCopiedDelay.tsx
generateRandomAmplitudes
called by 1
src/components/PlayButton.tsx
handler
called by 1
src/components/DownloadButton.tsx

Shape

Function 68
Interface 8
Class 2
Method 1

Languages

TypeScript100%

Modules by API surface

src/components/ui/Icons.tsx13 symbols
src/components/PlayButton.tsx6 symbols
src/components/ui/Button.tsx5 symbols
src/lib/store.ts4 symbols
src/hooks/useServiceWorker.ts4 symbols
src/components/TTSPage.tsx4 symbols
src/components/DownloadButton.tsx4 symbols
src/lib/library.ts3 symbols
src/components/ui/Header.tsx3 symbols
src/components/ui/Footer.tsx3 symbols
src/components/ui/Block.tsx3 symbols
src/hooks/useCopiedDelay.tsx2 symbols

Dependencies from manifests, versioned

@codemirror/lang-javascript6.2.3 · 1×
@codemirror/lang-python6.1.7 · 1×
@codemirror/legacy-modes6.5.0 · 1×
@eslint/eslintrc3 · 1×
@radix-ui/react-switch1.1.3 · 1×
@radix-ui/react-toast1.2.6 · 1×
@types/node20 · 1×
@types/react19 · 1×
@types/react-dom19 · 1×
@uiw/codemirror-theme-duotone4.23.10 · 1×

Datastores touched

database_nameDatabase · 1 repos

For agents

$ claude mcp add openai-fm \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact