npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@openpets/openai

v1.0.3

Published

Access OpenAI's powerful APIs including GPT models, DALL-E, Whisper, and more through OpenPets.

Readme

OpenAI Pet

Access OpenAI's powerful APIs including GPT models, DALL-E, Whisper, and more through OpenPets.

Quick Start

1. Get an API Key

  1. Go to platform.openai.com/api-keys
  2. Create a new API key
  3. Copy the key

2. Configure Environment

cp .env.example .env
# Edit .env and add your API key

Or set the environment variable directly:

export OPENAI_API_KEY="sk-..."

3. Test Connection

opencode run "test openai connection"

Available Tools

Core Tools (Always Loaded)

These 21 tools are always available when configured:

| Category | Tools | |----------|-------| | Chat | openai-create-chat-completion, openai-list-chat-completions, openai-get-chat-completion, etc. | | Audio | openai-create-speech, openai-create-transcription, openai-create-translation, etc. | | Images | openai-create-image, openai-create-image-edit, openai-create-image-variation | | Models | openai-list-models, openai-retrieve-model, openai-delete-model |

Additional Tool Groups (LoadEnv)

Enable additional tool groups via environment variables:

# Enable file management tools (5 tools)
export OPENAI_LOAD_FILES_TOOLS=true

# Enable fine-tuning tools (13 tools)
export OPENAI_LOAD_FINE_TUNING_TOOLS=true

# Enable embeddings tools (1 tool)
export OPENAI_LOAD_EMBEDDINGS_TOOLS=true

# Enable realtime/voice tools (8 tools)
export OPENAI_LOAD_REALTIME_TOOLS=true

# Enable video generation tools (6 tools)
export OPENAI_LOAD_VIDEOS_TOOLS=true

# Enable organization/admin tools
export OPENAI_LOAD_PROJECTS_TOOLS=true
export OPENAI_LOAD_USERS_TOOLS=true
export OPENAI_LOAD_GROUPS_TOOLS=true

Example Usage

Chat Completions

opencode run "create a chat completion asking what the capital of France is"

List Models

opencode run "list all available openai models"

Generate Images

opencode run "generate an image of a sunset over mountains"

Transcribe Audio

opencode run "transcribe the audio file at /path/to/audio.mp3"

Text to Speech

opencode run "create speech from the text 'Hello world' using the alloy voice"

Environment Variables

Required

| Variable | Description | |----------|-------------| | OPENAI_API_KEY | Your OpenAI API key from platform.openai.com |

Optional

| Variable | Description | |----------|-------------| | OPENAI_ORGANIZATION | Organization ID for API requests | | OPENAI_HOST | Custom API host (default: https://api.openai.com/v1) |

Tool Group Toggles

| Variable | Description | |----------|-------------| | OPENAI_LOAD_FILES_TOOLS | Enable file upload/management tools | | OPENAI_LOAD_FINE_TUNING_TOOLS | Enable fine-tuning job tools | | OPENAI_LOAD_EMBEDDINGS_TOOLS | Enable embedding generation tools | | OPENAI_LOAD_REALTIME_TOOLS | Enable realtime/voice API tools | | OPENAI_LOAD_VIDEOS_TOOLS | Enable video generation tools | | OPENAI_LOAD_COMPLETIONS_TOOLS | Enable legacy completions API | | OPENAI_LOAD_MODERATIONS_TOOLS | Enable content moderation tools | | OPENAI_LOAD_CONVERSATIONS_TOOLS | Enable conversation management | | OPENAI_LOAD_RESPONSES_TOOLS | Enable response management | | OPENAI_LOAD_UPLOADS_TOOLS | Enable large file upload tools | | OPENAI_LOAD_EVALS_TOOLS | Enable evaluation tools | | OPENAI_LOAD_PROJECTS_TOOLS | Enable project management tools | | OPENAI_LOAD_USERS_TOOLS | Enable user management tools | | OPENAI_LOAD_GROUPS_TOOLS | Enable group management tools | | OPENAI_LOAD_ROLES_TOOLS | Enable role management tools | | OPENAI_LOAD_INVITES_TOOLS | Enable invite management tools | | OPENAI_LOAD_CERTIFICATES_TOOLS | Enable certificate management tools | | OPENAI_LOAD_AUDIT_LOGS_TOOLS | Enable audit log tools | | OPENAI_LOAD_USAGE_TOOLS | Enable usage statistics tools |

Tool Statistics

  • Total Tools: 171
  • Core Tools: 21 (always loaded)
  • LoadEnv Tools: 150 (require env var)
  • Read-Only Tools: 69
  • Write Tools: 102

Regenerating Tools

The OpenAPI tools are auto-generated from OpenAI's official specification. To regenerate:

cd pets/openai
pets generate-openapi --verbose

This fetches the latest spec from OpenAI and regenerates openapi-client.ts.

FAQ

How do I get an OpenAI API key?

Go to platform.openai.com/api-keys and create a new API key. You'll need an OpenAI account with billing enabled.

What models are available?

Use the openai-list-models tool to see all available models including GPT-4, GPT-3.5-turbo, DALL-E 3, Whisper, and more.

Why are some tools not showing?

By default only core tools (Chat, Audio, Images, Models) are loaded. Enable additional tool groups via environment variables like OPENAI_LOAD_FILES_TOOLS=true.

Can I use a custom API endpoint?

Yes, set OPENAI_HOST to your custom endpoint (e.g., for Azure OpenAI or a proxy).

How do I enable all tools?

Set all the OPENAI_LOAD_*_TOOLS=true environment variables, or add them to your .env file.