Skip to content

Commit 3c08056

Browse files
techpro-aimlapigitbook-bot
authored andcommitted
GITBOOK-319: docs: add openrouter/horizon-alpha
1 parent e957da1 commit 3c08056

7 files changed

Lines changed: 187 additions & 2 deletions

File tree

docs/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ If you've already made your choice and know the model ID, use the [Search panel]
119119

120120
<mark style="background-color:green;">**OpenAI**</mark>: [Text/Chat](api-references/text-models-llm/OpenAI/) [Image](api-references/image-models/OpenAI/) [Speech-To-Text](api-references/speech-voice-models/stt/OpenAI/) [Embedding](api-references/embedding-models/OpenAI/)&#x20;
121121

122+
**OpenRouter**: [Text/Chat](api-references/text-models-llm/openrouter/)
123+
122124
**Perplexity**: [Text/Chat](api-references/text-models-llm/perplexity/)
123125

124126
**RecraftAI**: [Image](api-references/image-models/RecraftAI/)

docs/SUMMARY.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@
9999
* [gpt-4.1-mini](api-references/text-models-llm/openai/gpt-4.1-mini.md)
100100
* [gpt-4.1-nano](api-references/text-models-llm/openai/gpt-4.1-nano.md)
101101
* [o4-mini](api-references/text-models-llm/openai/o4-mini.md)
102+
* [OpenRouter](api-references/text-models-llm/openrouter/README.md)
103+
* [horizon-alpha](api-references/text-models-llm/openrouter/horizon-alpha.md)
102104
* [Perplexity](api-references/text-models-llm/perplexity/README.md)
103105
* [sonar](api-references/text-models-llm/perplexity/sonar.md)
104106
* [sonar-pro](api-references/text-models-llm/perplexity/sonar-pro.md)
@@ -140,6 +142,7 @@
140142
* [Video Models](api-references/video-models/README.md)
141143
* [Alibaba Cloud](api-references/video-models/alibaba-cloud/README.md)
142144
* [Wan 2.1 (Text-to-Video)](api-references/video-models/alibaba-cloud/wan-2.1-text-to-video.md)
145+
* [Wan 2.1 Plus (Text-to-Video)](api-references/video-models/alibaba-cloud/wan-2.1-plus-text-to-video.md)
143146
* [ByteDance](api-references/video-models/bytedance/README.md)
144147
* [Seedance 1.0 lite (Text-to-Video)](api-references/video-models/bytedance/seedance-1.0-lite-text-to-video.md)
145148
* [Seedance 1.0 lite (Image-to-Video)](api-references/video-models/bytedance/seedance-1.0-lite-image-to-video.md)

docs/api-references/model-database.md

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/api-references/text-models-llm/README.md

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# OpenRouter
2+
Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
# horizon-alpha
2+
3+
{% hint style="info" %}
4+
This documentation is valid for the following model: `openrouter/horizon-alpha`
5+
{% endhint %}
6+
7+
## Model Overview
8+
9+
A model that outperforms [GPT-4](../OpenAI/gpt-4.md) and [Claude](../Anthropic/) on several benchmarks, handles 256,000 tokens of context, processes images, and generates code at 150 tokens per second.
10+
11+
## How to Make a Call
12+
13+
<details>
14+
15+
<summary>Step-by-Step Instructions</summary>
16+
17+
### :digit\_one: Setup You Can’t Skip
18+
19+
:black\_small\_square: [**Create an Account**](https://aimlapi.com/app/sign-up): Visit the AI/ML API website and create an account (if you don’t have one yet).\
20+
:black\_small\_square: [**Generate an API Key**](https://aimlapi.com/app/keys): After logging in, navigate to your account dashboard and generate your API key. Ensure that key is enabled on UI.
21+
22+
### &#x20;:digit\_two: Copy the code example
23+
24+
At the bottom of this page, you'll find [a code example](horizon-alpha.md#code-example) that shows how to structure the request. Choose the code snippet in your preferred programming language and copy it into your development environment.
25+
26+
### :digit\_three: Modify the code example
27+
28+
:black\_small\_square: Replace `<YOUR_AIMLAPI_KEY>` with your actual AI/ML API key from your account.\
29+
:black\_small\_square: Insert your question or request into the `content` field—this is what the model will respond to.
30+
31+
### :digit\_four: <sup><sub><mark style="background-color:yellow;">(Optional)<mark style="background-color:yellow;"><sub></sup> Adjust other optional parameters if needed
32+
33+
Only `model` and `messages` are required parameters for this model (and we’ve already filled them in for you in the example), but you can include optional parameters if needed to adjust the model’s behavior. Below, you can find the corresponding [API schema](horizon-alpha.md#api-schema), which lists all available parameters along with notes on how to use them.
34+
35+
### :digit\_five: Run your modified code
36+
37+
Run your modified code in your development environment. Response time depends on various factors, but for simple prompts it rarely exceeds a few seconds.
38+
39+
{% hint style="success" %}
40+
If you need a more detailed walkthrough for setting up your development environment and making a request step by step — feel free to use our [Quickstart guide](../../../quickstart/setting-up.md).
41+
{% endhint %}
42+
43+
</details>
44+
45+
## API Schema
46+
47+
{% openapi-operation spec="horizon-alpha" path="/v1/chat/completions" method="post" %}
48+
[OpenAPI horizon-alpha](https://raw.githubusercontent.com/aimlapi/api-docs/refs/heads/main/docs/api-references/text-models-llm/OpenRouter/horizon-alpha.json)
49+
{% endopenapi-operation %}
50+
51+
## Code Example
52+
53+
{% tabs %}
54+
{% tab title="Python" %}
55+
{% code overflow="wrap" %}
56+
```python
57+
import requests
58+
import json # for getting a structured output with indentation
59+
60+
response = requests.post(
61+
"https://api.aimlapi.com/v1/chat/completions",
62+
headers={
63+
"Content-Type":"application/json",
64+
65+
# Insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>:
66+
"Authorization":"Bearer <YOUR_AIMLAPI_KEY>",
67+
"Content-Type":"application/json"
68+
},
69+
json={
70+
"model":"openrouter/horizon-alpha",
71+
"messages":[
72+
{
73+
"role":"user",
74+
75+
# Insert your question for the model here, instead of Hello:
76+
"content":"Hello"
77+
}
78+
]
79+
}
80+
)
81+
82+
data = response.json()
83+
# getting a structured output with indentation
84+
print(json.dumps(data, indent=2, ensure_ascii=False))
85+
```
86+
{% endcode %}
87+
{% endtab %}
88+
89+
{% tab title="JavaScript" %}
90+
{% code overflow="wrap" %}
91+
```javascript
92+
async function main() {
93+
try {
94+
const response = await fetch('https://api.aimlapi.com/v1/chat/completions', {
95+
method: 'POST',
96+
headers: {
97+
// Insert your AIML API Key instead of YOUR_AIMLAPI_KEY
98+
'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>',
99+
'Content-Type': 'application/json',
100+
},
101+
body: JSON.stringify({
102+
model: 'openrouter/horizon-alpha',
103+
messages:[
104+
{
105+
role:'user',
106+
107+
// Insert your question for the model here, instead of Hello:
108+
content: 'Hello'
109+
}
110+
]
111+
}),
112+
});
113+
114+
if (!response.ok) {
115+
throw new Error(`HTTP error! Status ${response.status}`);
116+
}
117+
118+
const data = await response.json();
119+
console.log(JSON.stringify(data, null, 2));
120+
121+
} catch (error) {
122+
console.error('Error', error);
123+
}
124+
}
125+
126+
main();
127+
```
128+
{% endcode %}
129+
{% endtab %}
130+
{% endtabs %}
131+
132+
<details>
133+
134+
<summary>Response</summary>
135+
136+
{% code overflow="wrap" %}
137+
```json5
138+
{
139+
"id": "gen-1754061512-mKmkzKIsUnejaOPmTKcF",
140+
"object": "chat.completion",
141+
"choices": [
142+
{
143+
"index": 0,
144+
"finish_reason": "stop",
145+
"logprobs": null,
146+
"message": {
147+
"role": "assistant",
148+
"content": "Hello! How can I help you today?",
149+
"reasoning_content": null,
150+
"refusal": null
151+
}
152+
}
153+
],
154+
"created": 1754061512,
155+
"model": "openrouter/horizon-alpha",
156+
"usage": {
157+
"prompt_tokens": 0,
158+
"completion_tokens": 0,
159+
"total_tokens": 0,
160+
"prompt_tokens_details": {
161+
"cached_tokens": 0
162+
},
163+
"completion_tokens_details": {
164+
"reasoning_tokens": 0
165+
}
166+
}
167+
}
168+
```
169+
{% endcode %}
170+
171+
</details>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
hidden: true
3+
noIndex: true
4+
---
5+
6+
# Wan 2.1 Plus (Text-to-Video)
7+

0 commit comments

Comments
 (0)