> ## Documentation Index
> Fetch the complete documentation index at: https://www.edenai.co/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# First LLM Call

> Make your first call to Eden AI's OpenAI-compatible LLM endpoint and start building with 500+ models.

export const TechArticleSchema = ({title, description, path, articleSection, about, proficiencyLevel = "Beginner", dependencies, keywords = [], datePublished, dateModified, image, inLanguage = "en"}) => {
  const baseUrl = "https://www.edenai.co/docs";
  const canonicalUrl = `${baseUrl}/${path}`.replace(/\/+$/, "");
  const ogParams = new URLSearchParams({
    division: articleSection || "",
    title: title || "",
    description: description || ""
  });
  const resolvedImage = image || `https://edenai.mintlify.app/_mintlify/api/og?${ogParams.toString()}`;
  const data = {
    "@context": "https://schema.org",
    "@type": "TechArticle",
    "@id": `${canonicalUrl}#techarticle`,
    mainEntityOfPage: {
      "@type": "WebPage",
      "@id": canonicalUrl
    },
    headline: title,
    name: title,
    description: description,
    url: canonicalUrl,
    inLanguage: inLanguage,
    isPartOf: {
      "@type": "WebSite",
      name: "Eden AI Documentation",
      url: baseUrl
    },
    author: [{
      "@type": "Organization",
      name: "Eden AI",
      url: "https://www.edenai.co/"
    }],
    publisher: {
      "@type": "Organization",
      name: "Eden AI",
      url: "https://www.edenai.co/",
      logo: {
        "@type": "ImageObject",
        url: "https://www.edenai.co/assets/logo.png"
      }
    }
  };
  if (articleSection) data.articleSection = articleSection;
  if (about) data.about = {
    "@type": "Thing",
    name: about
  };
  if (proficiencyLevel) data.proficiencyLevel = proficiencyLevel;
  if (dependencies) data.dependencies = dependencies;
  if (keywords && keywords.length) data.keywords = keywords;
  if (datePublished) data.datePublished = datePublished;
  if (dateModified) data.dateModified = dateModified;
  data.image = Array.isArray(resolvedImage) ? resolvedImage : [resolvedImage];
  const json = JSON.stringify(data);
  const schemaId = `techarticle-${canonicalUrl}`;
  React.useEffect(() => {
    if (typeof document === "undefined") return;
    document.querySelectorAll(`script[data-schema-id="${schemaId}"]`).forEach(n => n.remove());
    const script = document.createElement("script");
    script.type = "application/ld+json";
    script.dataset.schemaId = schemaId;
    script.textContent = json;
    document.head.appendChild(script);
    return () => script.remove();
  }, [json, schemaId]);
  return null;
};

<TechArticleSchema
  title="First LLM Call with Eden AI"
  description="Learn how to make your first LLM API call using Eden AI. This quickstart guide walks you through authentication, request setup, and response handling."
  path="v3/quickstart/first-llm-call"
  articleSection="Quickstart"
  about="LLM API Integration"
  proficiencyLevel="Beginner"
  dependencies="You need an Eden AI account and an API key to perform your first LLM call."
  keywords={[
"Eden AI",
"LLM API",
"AI API integration",
"first API call",
"large language model",
"quickstart",
]}
  datePublished="2024-01-01T00:00:00Z"
  dateModified="2026-05-07T00:00:00Z"
/>

Get started with Eden AI's OpenAI-compatible LLM endpoint in minutes.

## Prerequisites

1. **API Token** - Get your token from the [Eden AI dashboard](https://app.edenai.run/)
2. **Credits** - Ensure your account has sufficient credits (or use a [sandbox token](/v3/general/sandbox) to test for free)

## Make Your First Call

Eden AI provides access to 300+ LLM models through a single OpenAI-compatible endpoint.

<CodeGroup>
  ```python Python theme={null}
  import requests

  url = "https://api.edenai.run/v3/chat/completions"
  headers = {
      "Authorization": "Bearer YOUR_API_KEY",
      "Content-Type": "application/json"
  }

  payload = {
      "model": "openai/gpt-4",
      "messages": [
          {"role": "user", "content": "Hello! How are you?"}
      ]
  }

  response = requests.post(url, headers=headers, json=payload)
  result = response.json()
  print(result["choices"][0]["message"]["content"])
  ```

  ```bash cURL theme={null}
  curl -X POST https://api.edenai.run/v3/chat/completions \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "openai/gpt-4",
      "messages": [{"role": "user", "content": "Hello!"}]
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.edenai.run/v3/chat/completions', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      model: 'openai/gpt-4',
      messages: [{role: 'user', content: 'Hello!'}]
    })
  });

  const result = await response.json();
  console.log(result.choices[0].message.content);
  ```
</CodeGroup>

## Response

```json theme={null}
{
  "id": "chatcmpl-123",
  "object": "chat.completion",
  "choices": [
    {
      "message": {"role": "assistant", "content": "Hello! I'm doing well, thank you."},
      "index": 0,
      "finish_reason": "stop"
    }
  ],
  "usage": {"prompt_tokens": 12, "completion_tokens": 10, "total_tokens": 22}
}
```

## Using OpenAI SDK

You can use the official OpenAI SDK with Eden AI:

```python Python theme={null}
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_EDEN_AI_API_KEY",
    base_url="https://api.edenai.run/v3"
)

response = client.chat.completions.create(
    model="anthropic/claude-sonnet-4-5",
    messages=[{"role": "user", "content": "Hello!"}]
)

print(response.choices[0].message.content)
```

## Model Format

Use the format `provider/model`:

* `openai/gpt-4`
* `anthropic/claude-sonnet-4-5`
* `google/gemini-2.5-flash`
* `mistral/mistral-large`

<Card title="List all available models" icon="list" href="/v3/llms/listing-models">
  Discover all 315+ LLM models available through Eden AI.
</Card>

## Next Steps

<CardGroup cols={2}>
  <Card title="Streaming" icon="brain" href="/v3/llms/streaming">
    Enable real-time streaming responses
  </Card>

  <Card title="File Attachments" icon="brain" href="/v3/llms/file-upload">
    Send images and documents to LLMs
  </Card>

  <Card title="Smart Routing" icon="brain" href="/v3/llms/smart-routing">
    Automatic model selection and fallbacks
  </Card>

  <Card title="Chat Completions" icon="brain" href="/v3/llms/chat-completions">
    Full reference for the chat completions endpoint
  </Card>
</CardGroup>
