Back to skills
SKILL.md
601 Model Information Api 46c2efb8
ASecurity```python def get_model_info(model_id): response = requests.get( "https://openrouter.ai/api/v1/models", headers={"Authorization": f"Bearer {api_key}"} ) models = response.json()["data"] return next((m for m in models if m["id"] == model_id), None)
- 9 stars
- 0 votes
- 0 copies
- 0 views
- Added October 11, 2026
Works with
Security analysis
100/100Pro scans all 2 files and shows the line behind each finding
npx -y skills add tools-only/X-Skills --skill 601-model-information-api_46c2efb8 --agent claude-codeAre you the author of 601 Model Information Api 46c2efb8?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/tools-only-601-model-information-api-46c2efb8)# Model Information Api
## Model Information API
### Get Model Details
```python
def get_model_info(model_id):
response = requests.get(
"https://openrouter.ai/api/v1/models",
headers={"Authorization": f"Bearer {api_key}"}
)
models = response.json()["data"]
return next((m for m in models if m["id"] == model_id), None)
model = get_model_info("anthropic/claude-3.5-sonnet")
print(f"Context: {model['context_length']}")
print(f"Prompt cost: ${model['pricing']['prompt']}/token")
print(f"Completion cost: ${model['pricing']['completion']}/token")
```
### Model Schema
```json
{
"id": "anthropic/claude-3.5-sonnet",
"name": "Claude 3.5 Sonnet",
"description": "...",
"context_length": 200000,
"pricing": {
"prompt": "0.000003",
"completion": "0.000015"
},
"top_provider": {
"context_length": 200000,
"max_completion_tokens": 8192
},
"per_request_limits": null
}
```Files in this skill
- README.md
- skill.md
Attribution
Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.