LFM2-24B-A2B API

liquid/lfm-2-24b-a2b
LFM2-24B-A2B on AIMLAPI.
Context
128K tokens
Input
$0.039 / 1M
Output
$0.156 / 1M

How to use LFM2-24B-A2B API

Install any OpenAI-compatible SDK, point it at api.aimlapi.com/v1, and set the model to liquid/lfm-2-24b-a2b.
import requests

r = requests.post(
    "https://api.aimlapi.com/v1/chat/completions",
    headers={"Authorization": "Bearer " + AIMLAPI_KEY},
    json={
      "model": "liquid/lfm-2-24b-a2b",
      "messages": [
        {
          "role": "user",
          "content": "Hello!"
        }
      ]
    },
)
print(r.json())
const r = await fetch("https://api.aimlapi.com/v1/chat/completions", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.AIMLAPI_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "model": "liquid/lfm-2-24b-a2b",
    "messages": [
      {
        "role": "user",
        "content": "Hello!"
      }
    ]
  }),
});
console.log(await r.json());
curl -X POST https://api.aimlapi.com/v1/chat/completions \
  -H "Authorization: Bearer $AIMLAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"liquid/lfm-2-24b-a2b","messages":[{"role":"user","content":"Hello!"}]}'

OpenAI-compatible — swap the base URL and it works with your existing SDK.

LFM2-24B-A2B API Pricing

TypePrice
Input
$0.039 / 1M
Output
$0.156 / 1M

LFM2-24B-A2B Benchmarks

BenchmarkScoreWhat it measuresSourceRetrieved
Intelligence
5.9
Composite score across standardised reasoning, knowledge and problem-solving evaluations, measured independently by Artificial AnalysisSourceSeptember 12, 2026

LFM2-24B-A2B vs other models

ModelInputOutputContextBest for
LFM2-24B-A2B
This page
$0.039 / 1M
$0.156 / 1M
128K tokens
Reasoning + agents
$6.5 / 1M tokens
$39 / 1M tokens
1.05M tokens
Reasoning + agents
$2.6 / 1M tokens
$13 / 1M tokens
1M tokens
Balanced coding + agents
$3.9 / 1M tokens
$19.5 / 1M tokens
1M tokens
Long-context, multimodal & agentic workflows
$0.65 / 1M tokens
$3.9 / 1M tokens
1.05M tokens
Reasoning + agents

Frequently asked questions

LFM2-24B-A2B has a 128,000 tokens context window.

LFM2-24B-A2B takes image, text as input and returns text.

Use liquid/lfm-2-24b-a2b as the model id. Requests go to https://api.aimlapi.com/v1/chat/completions.

LFM2-24B-A2B is priced at input $0.039 / 1M, output $0.156 / 1M.

Yes, LFM2-24B-A2B can stream responses as they are generated.

Yes, LFM2-24B-A2B accepts image input alongside text.

Yes, it supports function calling, tool use, and parallel tool calls.

Start building with LFM2-24B-A2B

Get API Key
1000+ models, one API.