AI Prompt Optimizer Agent Skill — AI Pass API
Overview
What this skill does
- The AI Pass "AI Prompt Optimizer" skill analyzes, rewrites, and improves AI prompts to produce clearer, more specific, and more consistent outputs.
- It focuses on maximizing prompt clarity, reducing ambiguity, enforcing constraints, and improving instruction structure so downstream models provide higher-quality results.
Use cases for AI agents
- Automatically rewrite user-provided prompts before forwarding them to a model to increase reliability and reduce follow-up clarifications.
- Provide multiple optimized prompt variants (concise, detailed, constrained) so an agent can choose the best one for a task.
- Normalize prompt style and include required context, system instructions, or token/length constraints for pipelines that call multiple models.
- Convert informal user requests into production-ready prompts for content generation, data extraction, summarization, or code generation.
Skill File (YAML)
name: prompt-optimizer
description: Rewrites and improves AI prompts to get better, more consistent results
version: "1.0"
auth:
type: bearer
token_env: AIPASS_API_KEY
endpoints:
- name: generate
method: POST
url: https://aipass.one/apikey/v1/chat/completions
headers:
Authorization: "Bearer $AIPASS_API_KEY"
Content-Type: application/json
Example Usage
curl example
curl -s -X POST "https://aipass.one/apikey/v1/chat/completions" \
-H "Authorization: Bearer $AIPASS_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Client-ID: YOUR_CLIENT_ID" \
-d '{
"model": "aipass-4o-chat",
"messages": [
{"role": "system", "content": "You are an expert prompt engineer. Rewrite the user prompt to maximize clarity, specificity, and expected output quality. Provide the optimized prompt and a 1-2 sentence rationale."},
{"role": "user", "content": "Write me a blog post about remote work that converts readers into subscribers. Product: weekly newsletter about remote work tips."}
],
"temperature": 0.2,
"max_tokens": 400
}'
Python example
import os
import requests
API_URL = "https://aipass.one/apikey/v1/chat/completions"
API_KEY = os.environ.get("AIPASS_API_KEY") # ensure this is set in your environment
HEADERS = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
"X-Client-ID": "YOUR_CLIENT_ID"
}
payload = {
"model": "aipass-4o-chat",
"messages": [
{"role": "system", "content": "You are an expert prompt engineer. Rewrite the user prompt to maximize clarity, specificity, and expected output quality. Provide the optimized prompt and a 1-2 sentence rationale."},
{"role": "user", "content": "Draft an about page for my startup focusing on sustainability and growth."}
],
"temperature": 0.2,
"max_tokens": 400
}
resp = requests.post(API_URL, headers=HEADERS, json=payload)
resp.raise_for_status()
print(resp.json())
Notes
- Keep temperature low (0.0–0.3) when you want consistent, deterministic prompt rewrites.
- Request multiple variants by asking the model to return numbered options if you need A/B testing.
Available Models
- aipass-3.5-chat — cost-effective, fast inference for standard prompt optimization tasks.
- aipass-4o-chat — balanced, high-quality chat model suitable for most prompt engineering needs.
- aipass-4-creative — higher-capacity model tuned for creative rewrites and tone/style variations.
- aipass-instruct-1 — instruction-tuned model focused on precise, constraint-following rewrites.
(Choose the model that matches your latency, cost, and creativity requirements.)
Get Your API Key
- Sign in to the developer dashboard and create an API key: https://aipass.one/panel/developer.html → API Keys section
- Always store keys securely and never embed real keys directly in code—use environment variables (AIPASS_API_KEY).
Related Apps
- Prompt Optimizer app: https://aipass.one/apps/prompt-optimizer
Note: Never include real API keys in code samples. Use the placeholder $AIPASS_API_KEY for all examples and YOUR_CLIENT_ID for any client ID references.
Skill File
id: ai_pass_prompt_optimizer
name: AI Pass Prompt Optimizer
version: 1.0.0
author: acme.ai
description: Rewrites and improves AI prompts to get better, more consistent results
auth:
type: apiKey
in: header
name: Authorization
env: AIPASS_API_KEY
prefix: "Bearer"
inputs:
prompt:
type: string
description: The original prompt to rewrite and optimize
required: true
target_style:
type: string
description: Optional. Desired tone/format for the optimized prompt (e.g., concise, detailed, step-by-step)
required: false
model:
type: string
description: Optional. Model to use for the rewrite (defaults to a recommended model for AI Pass)
required: false
default: "gpt-4o"
temperature:
type: number
description: Optional. Creativity (0.0-1.2). Lower values = more deterministic.
required: false
default: 0.2
max_tokens:
type: integer
description: Optional. Maximum tokens for the response.
required: false
default: 800
functions:
- name: optimize_prompt
description: Rewrites and improves AI prompts to get better, more consistent results
inputs:
- prompt
- target_style
- model
- temperature
- max_tokens
run:
http:
method: POST
url: https://aipass.one/apikey/v1/chat/completions
headers:
Content-Type: application/json
Authorization: "Bearer $AIPASS_API_KEY"
body:
model: "{{model}}"
temperature: "{{temperature}}"
max_tokens: "{{max_tokens}}"
messages:
- role: system
content: >-
You are an expert prompt engineer. Rewrite and improve the user's prompt so downstream AI models produce more accurate,
consistent, and reliable outputs. Preserve the original intent and any constraints. Output only the final optimized prompt
text, with no explanations or extra commentary.
- role: user
content: >-
Original prompt:
{{prompt}}
{{#if target_style}}
Desired style: {{target_style}}
{{/if}}
response:
status_codes: [200]
content_type: application/json
output_path: choices[0].message.content
outputs:
optimized_prompt:
type: string
description: The rewritten, optimized prompt returned by AI Pass
from: functions.optimize_prompt.response.output_path
metadata:
ready_for: OpenClaw
notes: >
Uses the $AIPASS_API_KEY environment variable for authentication. The function posts to
https://aipass.one/apikey/v1/chat/completions using the Chat Completions schema and returns the optimized prompt.
Download Skill File