Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
alphaonedev avatar

Openai Api

  • 49 installs
  • 6 repo stars
  • Updated March 13, 2026
  • alphaonedev/openclaw-graph

openai-api is a Claude skill for direct access to the OpenAI API, covering completions, chat, function calling, assistants, and embeddings.

About

openai-api is a skill for direct access to the OpenAI API. A developer uses it to generate text and chat completions, call functions, manage assistants, and create embeddings for semantic search. It documents the endpoints, authentication via OPENAI_API_KEY, request payloads, and rate-limit handling.

  • Wraps OpenAI chat and text completions, embeddings, and assistants
  • Covers function calling and fine-tuning endpoints
  • Documents auth, JSON payloads, and retry with exponential backoff

Openai Api by the numbers

  • 49 all-time installs (skills.sh)
  • Ranked #7,329 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
At a glance

openai-api capabilities & compatibility

Needs an OPENAI_API_KEY; usage incurs OpenAI API costs.

Works with
openai
Use cases
orchestration
Pricing
Bring your own API key
From the docs

What openai-api says it does

This skill provides direct access to the OpenAI API for tasks like generating text completions, handling function calls, managing assistants, and creating embeddings.
SKILL.md
It's designed for AI agents to integrate OpenAI's capabilities into workflows.
SKILL.md
Always set the API key via environment variable: export OPENAI_API_KEY=your_api_key.
SKILL.md
npx skills add https://github.com/alphaonedev/openclaw-graph --skill openai-api

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs49
repo stars6
Last updatedMarch 13, 2026
Repositoryalphaonedev/openclaw-graph

What it does

Call the OpenAI API for completions, embeddings, function calling, and assistants.

Who is it for?

dynamic text generation, embeddings for semantic search, or function calling for tool integration

Skip if: simple tasks; reserve for complex AI-driven operations where OpenAI's models outperform local alternatives

When should I use this skill?

you need dynamic text generation, embeddings, or function calling for tool integration

What you get

OpenAI completions, embeddings, and function-calling responses integrated into a workflow.

  • text and chat completions
  • embeddings
  • function-calling responses

By the numbers

  • covers 6 capability groups (completions, chat, function calling, assistants, embeddings, fine-tuning)

Files

SKILL.mdMarkdownGitHub ↗

openai-api

Purpose

This skill provides direct access to the OpenAI API for tasks like generating text completions, handling function calls, managing assistants, and creating embeddings. It's designed for AI agents to integrate OpenAI's capabilities into workflows.

When to Use

Use this skill when you need dynamic text generation (e.g., for chatbots), embeddings for semantic search, or function calling for tool integration. Apply it in scenarios requiring real-time AI responses, such as code generation, content summarization, or data analysis. Avoid it for simple tasks; reserve for complex AI-driven operations where OpenAI's models outperform local alternatives.

Key Capabilities

  • Text completions: Use the /completions endpoint for basic prompt-based generation with models like text-davinci-003.
  • Chat completions: Leverage /chat/completions for conversational AI, supporting role-based messages and tools.
  • Function calling: Enable tools via /chat/completions by defining functions in the request body for dynamic API interactions.
  • Assistants: Manage custom assistants through /assistants endpoints for persistent AI agents with tools and files.
  • Embeddings: Generate vector representations via /embeddings for applications like similarity search.
  • Fine-tuning: Access /fine-tunes for customizing models, though this requires specific input formats like JSONL files.

Usage Patterns

Always set the API key via environment variable: export OPENAI_API_KEY=your_api_key. Make requests to the base URL https://api.openai.com/v1/. For CLI or script usage, use tools like curl or OpenAI's SDK. Structure requests with JSON payloads, including parameters like model (e.g., gpt-3.5-turbo) and max_tokens (e.g., 150). Handle rate limits by implementing retry logic with exponential backoff. To use function calling, include a "tools" array in your request and check the response for "tool_calls".

Common Commands/API

Interact via HTTP requests or the OpenAI SDK. For authentication, include the header: Authorization: Bearer $OPENAI_API_KEY. Key endpoints:

  • For text completion: POST to /completions with body {"model": "text-davinci-003", "prompt": "Hello world", "max_tokens": 50}.

Example snippet:

  curl https://api.openai.com/v1/completions \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "text-davinci-003", "prompt": "Explain AI"}'
  • For chat completion: POST to /chat/completions with body {"model": "gpt-3.5-turbo", "messages": [{"role": "user", "content": "Hello"}], "tools": [...]}.

Example snippet:

  curl https://api.openai.com/v1/chat/completions \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -d '{"model": "gpt-3.5-turbo", "messages": [{"role": "user", "content": "Summarize this: AI is changing the world"}]}'
  • For embeddings: POST to /embeddings with body {"model": "text-embedding-ada-002", "input": "Your text here"}.

Example: Use in code as: response = openai.Embedding.create(model="text-embedding-ada-002", input="Hello")

  • Config format: Requests often use JSON like {"temperature": 0.7, "top_p": 1} for controlling output randomness.

Integration Notes

Integrate by importing the OpenAI SDK in your language (e.g., pip install openai for Python). Set up event-driven patterns, like triggering completions on user input. For function calling, define tools as a list of dictionaries (e.g., {"type": "function", "function": {"name": "get_weather", "parameters": {"location": "string"}}}). Ensure compatibility with other AI APIs by standardizing response formats. Use webhooks for assistants to handle asynchronous events. Test integrations with mock servers to avoid real API costs.

Error Handling

Common errors include 429 (rate limit exceeded), 401 (unauthorized), and 400 (bad request). Check response status codes and parse error messages from the JSON body (e.g., {"error": {"message": "Invalid model", "type": "invalid_request_error"}}). Implement retry logic for transient errors: use a loop with time.sleep() for delays. For authentication failures, verify $OPENAI_API_KEY is set and not expired. Log errors with details like error code and message, then fallback to default responses or alternative skills.

Graph Relationships

  • Connected to cluster: ai-apis
  • Related tags: ai-apis, api
  • Potential links: Integrates with skills in the same cluster, such as other AI APIs for combined workflows; depends on authentication services for key management.

Related skills

FAQ

How is the API authenticated?

Set the API key via the OPENAI_API_KEY environment variable and pass it as an Authorization Bearer header.

How does it handle rate limits?

Implement retry logic with exponential backoff for transient errors like 429.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.