Direct Meta Support: Muse Spark 1.3 and Muse Image 1.0
Date: 2026-10-21 (۱۴۰۵-۰۷-۲۹)
Summary
AvalAI now supports Meta directly through meta.ai, with Muse Spark 1.3 for reasoning and coding and Muse Image 1.0 for image generation. Both are available from Tier 1. These two direct Meta models currently carry an additional 15% billing-processing fee over official Meta pricing.
Available Models and Endpoints
This adds a direct Meta provider integration, separate from Meta's Llama models hosted by partners and Muse Glimmer hosted through Fireworks.ai. Use the exact IDs below with your existing AvalAI API key; a separate Meta API key is not needed for requests through AvalAI.
| Model | Exact AvalAI ID | Supported AvalAI endpoints | Access |
|---|---|---|---|
| Muse Spark 1.3 | muse-spark-1.3 | /v1/chat/completions, /v1/messages, /v1/responses (partial) | Tier 1 and higher |
| Muse Image 1.0 | muse-image-1.0 | /v1/images/generations only | Tier 1 and higher |
Muse Spark 1.3
Muse Spark is Meta's hosted reasoning model for coding, complex problem solving, and long-running agent workflows. Meta describes parallel tool calls, streamed tool-call arguments, and reasoning continuity across turns in its Model API. These upstream capabilities do not establish full feature parity on every AvalAI endpoint.
The current AvalAI catalog records:
- Maximum input: 1,048,576 tokens.
- Maximum output: 131,072 tokens. These are separate limits, not additive guaranteed capacity for one request.
- Capabilities: reasoning, vision, PDF input, function calling, parallel function calling, structured output, and prompt caching. Availability of individual controls depends on the selected endpoint.
- Endpoint compatibility: Chat Completions and Messages are supported; Responses support is partial.
Start with a basic text request. Verify tool schemas, streaming events, multimodal inputs, and any reasoning controls separately before moving an agent workflow. Do not assume OpenAI hosted tools, stored Responses continuation, or another provider's thinking and effort parameters work unchanged. Request a final answer or concise rationale, not hidden chain-of-thought.
Muse Image 1.0
Muse Image generates images from text prompts. Meta describes a reasoning-based composition process suited to structured layouts, illustrations, product imagery, and creative assets. Describe the subject, composition, style, lighting, and any short text explicitly; check generated labels and numbers before publishing. Repeated requests can produce different results.
AvalAI currently supports generation only for muse-image-1.0. Do not send it to /v1/images/edits, /v1/images/variations, Chat Completions, Messages, or Responses. Meta's own documentation also describes editing, reference-image composition, and multi-turn Responses image workflows; those features are not part of this AvalAI release.
Meta describes upstream output up to 1600px. This is not a confirmed AvalAI resolution guarantee or a reason to copy OpenAI-specific size, quality, style, streaming, or image-tool settings. The examples below use only model, prompt, and n: 1.
Official Pricing and the Billing-Processing Fee
AvalAI remains committed to 0% fee / no markup over official provider pricing as its general policy. Direct access to muse-spark-1.3 and muse-image-1.0 is a disclosed exception: an additional 15% billing-processing fee currently covers AvalAI's extra payment and billing overhead for providing meta.ai models.
This is an AvalAI processing charge in addition to Meta's official price, not a Meta price increase. The fee may change once those overheads are resolved; there is no promised change or removal date. It does not introduce a new fee for all Meta-owned models hosted through other providers or change pricing for unrelated models.
All amounts below are in USD. Spark rates are per 1 million tokens; Image rates are per output image.
| Model / charge | Official Meta rate | Additional 15% processing charge | AvalAI billed rate |
|---|---|---|---|
muse-spark-1.3: input / 1M tokens | $1.25 | $0.1875 | $1.4375 |
muse-spark-1.3: cached input / 1M tokens | $0.15 | $0.0225 | $0.1725 |
muse-spark-1.3: output / 1M tokens | $4.25 | $0.6375 | $4.8875 |
muse-image-1.0: output / image | $0.01 | $0.0015 | $0.0115 |
Billed rate = official rate × 1.15. The billed rates already include the fee; do not add another 15% to them. For example, 100 output images cost $1.15 at these rates, compared with Meta's $1.00 base charge. Zero token-rate fields in an image pricing record do not make image generation free: use the per-image output charge.
The cached-input rate applies only to input actually reported as a cache hit. It does not guarantee a cache hit, define a cache lifetime, or establish support for a particular cache-control parameter. See Pricing for calculation guidance and current pricing sources.
API Request and Response Examples
Set AVALAI_API_KEY to your AvalAI key and keep it server-side. The Python and JavaScript tabs require the corresponding OpenAI SDK, or the Anthropic SDK for Messages.
Response samples are illustrative, not captured from live requests. IDs, timestamps, generated text, and token counts are examples. Text samples use 20 uncached input tokens and 100 output tokens to demonstrate $0.0005175 of fee-inclusive cost. The exchange rate of 100,000 Tomans per USD is illustrative, not a current quote. The optional estimated_cost and usage fields can differ or be absent; use the User API for authoritative billing. Tool and reasoning responses can contain additional typed items or content blocks.
1. Muse Spark with Chat Completions
curl https://api.avalai.ir/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $AVALAI_API_KEY" \
-d '{
"model": "muse-spark-1.3",
"messages": [{"role": "user", "content": "Give a concise checklist for reviewing an API change."}]
}'import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AVALAI_API_KEY"],
base_url="https://api.avalai.ir/v1",
)
response = client.chat.completions.create(
model="muse-spark-1.3",
messages=[
{
"role": "user",
"content": "Give a concise checklist for reviewing an API change.",
}
],
)
print(response.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.AVALAI_API_KEY,
baseURL: "https://api.avalai.ir/v1",
});
const response = await client.chat.completions.create({
model: "muse-spark-1.3",
messages: [{ role: "user", content: "Give a concise checklist for reviewing an API change." }],
});
console.log(response.choices[0].message.content);Illustrative response:
{
"id": "chatcmpl-example",
"created": 1792584000,
"model": "muse-spark-1.3",
"object": "chat.completion",
"system_fingerprint": null,
"choices": [
{
"finish_reason": "stop",
"index": 0,
"message": {
"role": "assistant",
"content": "Check compatibility, authentication, validation, errors, tests, and billing.",
"thinking_blocks": [],
"annotations": []
}
}
],
"usage": {
"prompt_tokens": 20,
"completion_tokens": 100,
"total_tokens": 120,
"prompt_tokens_details": {
"cached_tokens": 0
},
"completion_tokens_details": null
},
"estimated_cost": {
"unit": "0.0005175000",
"irt": 51.75,
"exchange_rate": 100000
}
}2. Muse Spark with Messages
Messages uses the Anthropic-compatible schema, not the Chat Completions response shape. The Anthropic SDK base URL is https://api.avalai.ir without /v1 because the SDK appends /v1/messages. max_tokens is required; increase the example's budget within the model maximum if your reasoning task needs more space.
curl https://api.avalai.ir/v1/messages \
-H "Content-Type: application/json" \
-H "x-api-key: $AVALAI_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-d '{
"model": "muse-spark-1.3",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Give a concise checklist for reviewing an API change."}]
}'import os
from anthropic import Anthropic
client = Anthropic(
api_key=os.environ["AVALAI_API_KEY"],
base_url="https://api.avalai.ir",
)
response = client.messages.create(
model="muse-spark-1.3",
max_tokens=1024,
messages=[
{
"role": "user",
"content": "Give a concise checklist for reviewing an API change.",
}
],
)
for block in response.content:
if block.type == "text":
print(block.text)import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
apiKey: process.env.AVALAI_API_KEY,
baseURL: "https://api.avalai.ir",
});
const response = await client.messages.create({
model: "muse-spark-1.3",
max_tokens: 1024,
messages: [{ role: "user", content: "Give a concise checklist for reviewing an API change." }],
});
for (const block of response.content) {
if (block.type === "text") console.log(block.text);
}Illustrative response:
{
"id": "msg-example",
"type": "message",
"role": "assistant",
"model": "muse-spark-1.3",
"content": [
{
"type": "text",
"text": "Check compatibility, authentication, validation, errors, tests, and billing."
}
],
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {
"input_tokens": 20,
"output_tokens": 100
},
"estimated_cost": {
"unit": "0.0005175000",
"irt": 51.75,
"exchange_rate": 100000
}
}3. Muse Spark with Responses: partial support
This is a basic text-only compatibility example. Send input, not messages, and read response.output_text in the SDK. Raw JSON carries text inside typed output items. This example does not establish support for hosted tools, background jobs, stored conversations, previous_response_id, or the OpenAI reasoning object.
curl https://api.avalai.ir/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $AVALAI_API_KEY" \
-d '{
"model": "muse-spark-1.3",
"input": "Give a concise checklist for reviewing an API change."
}'import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AVALAI_API_KEY"],
base_url="https://api.avalai.ir/v1",
)
response = client.responses.create(
model="muse-spark-1.3",
input="Give a concise checklist for reviewing an API change.",
)
print(response.output_text)import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.AVALAI_API_KEY,
baseURL: "https://api.avalai.ir/v1",
});
const response = await client.responses.create({
model: "muse-spark-1.3",
input: "Give a concise checklist for reviewing an API change.",
});
console.log(response.output_text);Illustrative response:
{
"id": "resp-example",
"object": "response",
"created_at": 1792584000,
"status": "completed",
"error": null,
"incomplete_details": null,
"model": "muse-spark-1.3",
"output": [
{
"id": "msg-output-example",
"type": "message",
"status": "completed",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "Check compatibility, authentication, validation, errors, tests, and billing.",
"annotations": []
}
]
}
],
"usage": {
"input_tokens": 20,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 100,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 120
},
"estimated_cost": {
"unit": "0.0005175000",
"irt": 51.75,
"exchange_rate": 100000
}
}4. Muse Image with Images Generations
The curl example saves the JSON response rather than printing a large Base64 payload. The SDK examples decode data[0].b64_json into an image file. Check the returned image format before serving it; the WebP filename follows Meta's reference example and is not a format-selection parameter.
curl https://api.avalai.ir/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $AVALAI_API_KEY" \
-d '{
"model": "muse-image-1.0",
"prompt": "A watercolor painting of a red fox in a snowy pine forest, soft golden morning light.",
"n": 1
}' --output muse-image-response.jsonimport base64
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AVALAI_API_KEY"],
base_url="https://api.avalai.ir/v1",
)
response = client.images.generate(
model="muse-image-1.0",
prompt="A watercolor painting of a red fox in a snowy pine forest, soft golden morning light.",
n=1,
)
image_base64 = response.data[0].b64_json
if not image_base64:
raise ValueError("The response did not include Base64 image data.")
with open("muse-image.webp", "wb") as image_file:
image_file.write(base64.b64decode(image_base64))import OpenAI from "openai";
import { writeFile } from "node:fs/promises";
const client = new OpenAI({
apiKey: process.env.AVALAI_API_KEY,
baseURL: "https://api.avalai.ir/v1",
});
const response = await client.images.generate({
model: "muse-image-1.0",
prompt: "A watercolor painting of a red fox in a snowy pine forest, soft golden morning light.",
n: 1,
});
const imageBase64 = response.data?.[0]?.b64_json;
if (!imageBase64) throw new Error("The response did not include Base64 image data.");
await writeFile("muse-image.webp", Buffer.from(imageBase64, "base64"));Illustrative response; only the long Base64 value is truncated. usage: null illustrates a response without token accounting; the image still has a per-image cost.
{
"created": 1792584000,
"data": [
{
"b64_json": "UklGR...[TRUNCATED]"
}
],
"usage": null,
"estimated_cost": {
"unit": "0.0115000000",
"irt": 1150,
"exchange_rate": 100000
}
}Getting Started and Limitations
- Create a key in the AvalAI Dashboard and confirm Tier 1 or higher access.
- Select
muse-spark-1.3for reasoning/text workloads ormuse-image-1.0for text-to-image generation; they are not interchangeable. - Use the supported endpoint and its own request/response schema. Validate advanced Spark features separately; keep Muse Image on Images Generations only.
- Check rate limits and budget using the fee-inclusive billed rates. Queue image requests and handle rate-limit errors instead of assuming upstream Meta quotas apply to your AvalAI account.