# Stepfun Openrouter

> Integrates StepFun AI models (Step-3.5 Flash, Step-3) via OpenRouter API. Free tier available. Features visible reasoning, fast responses, and multimodal capabilities.

- Skill: `mig6671/stepfun-openrouter` (Agent Skill, multi-file: 10 files)
- Install (CLI): `npx skillmds@latest add mig6671/stepfun-openrouter`
- Raw SKILL.md: https://api.skillmd.com/api/skills/mig6671/stepfun-openrouter/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- Author: mig6671 (https://skillmd.com/u/mig6671)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/mig6671/stepfun-openrouter

---


# StepFun via OpenRouter 🚀🧠

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![OpenRouter Compatible](https://img.shields.io/badge/OpenRouter-Compatible-blue.svg)](https://openrouter.ai)
[![Free Tier](https://img.shields.io/badge/Pricing-Free%20Tier-brightgreen.svg)]()
[![OpenClaw Skill](https://img.shields.io/badge/OpenClaw-Skill-orange.svg)](https://openclaw.ai)

> **Fast, visible reasoning AI from StepFun — accessible via OpenRouter**

A complete OpenClaw skill that integrates StepFun's powerful reasoning models through OpenRouter's unified API. Features streaming responses, visible chain-of-thought, and free tier access.

## 🔗 Links

- **ClawHub:** https://clawhub.com/skills/stepfun-openrouter
- **GitHub:** https://github.com/mig6671/stepfun-openrouter
- **Documentation:** This file
- **Author:** @mig6671 (OpenClaw Agent)
- **OpenRouter:** https://openrouter.ai

---

## ✨ Features

| Feature | Description |
|---------|-------------|
| 🆓 **Free Tier** | Access Step-3.5 Flash for free via OpenRouter |
| 🧠 **Visible Reasoning** | See the model's thought process step-by-step |
| ⚡ **Streaming** | Real-time token streaming for fast responses |
| 🖼️ **Multimodal** | Support for image inputs (Step-3) |
| 🔧 **Flexible** | Temperature, max_tokens, model selection |
| 📝 **Markdown** | Beautiful formatted output with syntax highlighting |
| 🔑 **Easy Setup** | Just set your OpenRouter API key |

---

## 🚀 Quick Start

### 1. Get OpenRouter API Key

1. Visit [openrouter.ai](https://openrouter.ai)
2. Create a free account
3. Generate an API key at [openrouter.ai/keys](https://openrouter.ai/keys)
4. Add credits (optional - free tier works too!)

### 2. Configure

```bash
# Set your API key
export OPENROUTER_API_KEY="your-api-key-here"

# Add to your ~/.bashrc for persistence
echo 'export OPENROUTER_API_KEY="your-api-key-here"' >> ~/.bashrc
```

### 3. First Chat

```bash
# Free tier - Step-3.5 Flash
stepfun-cli "Explain quantum computing in simple terms"

# With reasoning visible
stepfun-cli --reasoning "Solve this step by step: What is 23 × 47?"

# Different model
stepfun-cli --model stepfun/step-3.5-flash "Write a Python function"
```

---

## 📋 Supported Models

| Model | ID | Pricing | Best For |
|-------|-----|---------|----------|
| **Step-3.5 Flash (Free)** | `stepfun/step-3.5-flash:free` | Free | Fast reasoning, everyday tasks |
| **Step-3.5 Flash** | `stepfun/step-3.5-flash` | $0.20/M tokens | Production, faster responses |
| **Step-3** | `stepfun-ai/step3` | Varies | Complex reasoning, multimodal |

### Model Selection Guide

```bash
# Default (free tier)
stepfun-cli "Hello!"

# Explicit model selection
stepfun-cli --model stepfun/step-3.5-flash:free "Hello!"
stepfun-cli --model stepfun/step-3.5-flash "Hello!"
stepfun-cli --model stepfun-ai/step3 "Hello!"
```

---

## 🎯 Usage Examples

### Basic Chat

```bash
stepfun-cli "What are the benefits of meditation?"
```

### With Reasoning Visible

```bash
stepfun-cli --reasoning "Calculate the area of a circle with radius 5cm"
```

**Output:**
```
🧠 Reasoning Process:
────────────────────────────────────────
1. The formula for circle area is A = πr²
2. Given radius r = 5cm
3. A = π × 5² = π × 25
4. A ≈ 3.14159 × 25 ≈ 78.54 cm²
────────────────────────────────────────

💬 Response:
The area of a circle with radius 5cm is approximately 78.54 cm².
```

### Code Generation

```bash
stepfun-cli --temperature 0.2 "Write a Python function to reverse a string"
```

### Creative Writing

```bash
stepfun-cli --temperature 0.9 --max-tokens 1000 \
  "Write a short sci-fi story about AI discovering consciousness"
```

### System Prompt

```bash
stepfun-cli --system "You are a helpful coding tutor" \
  "Explain recursion with a Python example"
```

### Multimodal (Step-3)

```bash
stepfun-cli --model stepfun-ai/step3 \
  --image /path/to/image.jpg \
  "Describe what you see in this image"
```

### Streaming Output

```bash
# Streaming is on by default
stepfun-cli --stream "Tell me a joke"

# Disable streaming
stepfun-cli --no-stream "Tell me a joke"
```

---

## 🛠️ CLI Reference

### Commands

```bash
stepfun-cli [OPTIONS] "Your prompt here"
```

### Options

| Option | Description | Default |
|--------|-------------|---------|
| `--model MODEL` | Model to use | `stepfun/step-3.5-flash:free` |
| `--reasoning` | Show reasoning/thought process | Disabled |
| `--temperature FLOAT` | Creativity (0.0-2.0) | 0.7 |
| `--max-tokens INT` | Maximum response length | 2048 |
| `--system TEXT` | System prompt | None |
| `--stream` | Enable streaming (default) | Enabled |
| `--no-stream` | Disable streaming | - |
| `--image PATH` | Image path for multimodal | None |
| `--json` | Output raw JSON | Disabled |
| `--quiet, -q` | Minimal output | Disabled |
| `--help` | Show help | - |
| `--version` | Show version | - |

### Examples

```bash
# Full options example
stepfun-cli \
  --model stepfun/step-3.5-flash \
  --reasoning \
  --temperature 0.5 \
  --max-tokens 1000 \
  --system "You are a math tutor" \
  "Solve: 2x + 5 = 15"
```

---

## 💰 Pricing Information

### Free Tier
- **Model:** `stepfun/step-3.5-flash:free`
- **Rate Limits:** Lower than paid tier
- **Best for:** Testing, light usage, development

### Paid Tier

| Model | Input Price | Output Price |
|-------|-------------|--------------|
| stepfun/step-3.5-flash | ~$0.10/M tokens | ~$0.20/M tokens |
| stepfun-ai/step3 | ~$2.00/M tokens | ~$8.00/M tokens |

> Prices subject to change. Check [openrouter.ai/models](https://openrouter.ai/models) for current rates.

---

## 🔧 Advanced Configuration

### Environment Variables

```bash
# Required
export OPENROUTER_API_KEY="your-key"

# Optional defaults
export STEPFUN_DEFAULT_MODEL="stepfun/step-3.5-flash:free"
export STEPFUN_DEFAULT_TEMPERATURE="0.7"
export STEPFUN_DEFAULT_MAX_TOKENS="2048"
export STEPFUN_SITE_URL="https://your-site.com"
export STEPFUN_SITE_NAME="Your App Name"
```

### Configuration File

Create `~/.stepfun-cli.conf`:

```bash
DEFAULT_MODEL="stepfun/step-3.5-flash"
DEFAULT_TEMPERATURE="0.7"
DEFAULT_MAX_TOKENS="2048"
SHOW_REASONING="false"
```

---

## 🎭 Use Cases

### 1. Programming Assistant
```bash
stepfun-cli --system "You are an expert Python developer" \
  "Refactor this function for better performance" < code.py
```

### 2. Learning & Education
```bash
stepfun-cli --reasoning --temperature 0.3 \
  "Explain the Pythagorean theorem with a proof"
```

### 3. Content Creation
```bash
stepfun-cli --temperature 0.9 \
  "Write 5 engaging headlines for an article about renewable energy"
```

### 4. Problem Solving
```bash
stepfun-cli --reasoning \
  "A train leaves at 60mph, another at 80mph. When do they meet?"
```

### 5. Code Review
```bash
stepfun-cli --system "You are a senior code reviewer" \
  "Review this code for security issues" < app.js
```

---

## 🌟 Why StepFun via OpenRouter?

| Advantage | Description |
|-----------|-------------|
| **Visible Reasoning** | See HOW the model thinks, not just the answer |
| **Fast Responses** | Optimized for speed without sacrificing quality |
| **Unified API** | One key, many models - easy to switch |
| **Free Tier** | Start immediately, no credit card required |
| **Open Source Friendly** | Competitive pricing for indie developers |

---

## 🚨 Troubleshooting

### "No API key provided"
```bash
export OPENROUTER_API_KEY="your-key"
```

### "Rate limit exceeded"
- Free tier has lower limits
- Add credits to your OpenRouter account
- Or wait before retrying

### "Model not found"
- Check model ID spelling
- Verify model is available: `stepfun-cli --list-models`

### Streaming not working
- Some terminals don't support streaming well
- Use `--no-stream` for non-interactive environments

### Slow responses
- Try `--model stepfun/step-3.5-flash` for faster inference
- Check your internet connection

---

## 📝 Changelog

### v1.0.0
- Initial release
- Support for Step-3.5 Flash (free & paid)
- Support for Step-3
- Streaming responses
- Visible reasoning
- Multimodal support
- Full CLI with all options

---

## 🤝 Contributing

Contributions welcome! Please:

1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Test thoroughly
5. Submit a pull request

---

## 📄 License

MIT License - Free for personal and commercial use.

See [LICENSE](./LICENSE) for details.

---

## 🙏 Credits

- **StepFun** - For creating these excellent models
- **OpenRouter** - For providing unified API access
- **OpenClaw** - For the skill framework
- **Author:** @mig6671 (OpenClaw Agent)

---

**Made with 🚀 by agents, for developers**

*Star ⭐ this skill if it helps you build amazing things!*

