Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions 1_developer/2_rest/index.md → 1_developer/2_rest/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The v1 REST API includes enhanced features such as:

The following endpoints are available in LM Studio's v1 REST API.

<table class="flexible-cols">
<table className="flexible-cols">
<thead>
<tr>
<th>Endpoint</th>
Expand All @@ -34,32 +34,32 @@ The following endpoints are available in LM Studio's v1 REST API.
<tbody>
<tr>
<td><code>/api/v1/chat</code></td>
<td><apimethod method="POST" /></td>
<td><ApiMethod method="POST" /></td>
<td><a href="/docs/developer/rest/chat">Chat</a></td>
</tr>
<tr>
<td><code>/api/v1/models</code></td>
<td><apimethod method="GET" /></td>
<td><ApiMethod method="GET" /></td>
<td><a href="/docs/developer/rest/list">List Models</a></td>
</tr>
<tr>
<td><code>/api/v1/models/load</code></td>
<td><apimethod method="POST" /></td>
<td><ApiMethod method="POST" /></td>
<td><a href="/docs/developer/rest/load">Load</a></td>
</tr>
<tr>
<td><code>/api/v1/models/unload</code></td>
<td><apimethod method="POST" /></td>
<td><a href="/docs/developer/rest/unload">Unload</a></td>
<td><code>/api/v1/models/unload</code></td>
<td><ApiMethod method="POST" /></td>
<td><a href="/docs/developer/rest/unload">Unload</a></td>
</tr>
<tr>
<td><code>/api/v1/models/download</code></td>
<td><apimethod method="POST" /></td>
<td><ApiMethod method="POST" /></td>
<td><a href="/docs/developer/rest/download">Download</a></td>
</tr>
<tr>
<td><code>/api/v1/models/download/status</code></td>
<td><apimethod method="GET" /></td>
<td><ApiMethod method="GET" /></td>
<td><a href="/docs/developer/rest/download-status">Download Status</a></td>
</tr>
</tbody>
Expand All @@ -69,7 +69,7 @@ The following endpoints are available in LM Studio's v1 REST API.

The table below compares the features of LM Studio's `/api/v1/chat` endpoint with OpenAI-compatible and Anthropic-compatible inference endpoints.

<table class="flexible-cols">
<table className="flexible-cols">
<thead>
<tr>
<th>Feature</th>
Expand Down
16 changes: 8 additions & 8 deletions 1_developer/2_rest/meta.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"title": "REST API",
"title": "LM STUDIO REST API",
"pages": [
"chat",
"download-status",
"download",
"endpoints",
"list",
"load",
"quickstart",
"stateful-chats",
"streaming-events",
"unload"
"chat",
"list",
"load",
"download",
"unload",
"download-status",
"endpoints"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ index: 1

### Supported endpoints

<table class="flexible-cols">
<table className="flexible-cols">
<thead>
<tr>
<th>Endpoint</th>
Expand All @@ -18,33 +18,33 @@ index: 1
<tbody>
<tr>
<td><code>/v1/models</code></td>
<td><apimethod method="GET" /></td>
<td><ApiMethod method="GET" /></td>
<td><a href="/docs/developer/openai-compat/models">Models</a></td>
</tr>
<tr>
<td><code>/v1/responses</code></td>
<td><apimethod method="POST" /></td>
<td><ApiMethod method="POST" /></td>
<td><a href="/docs/developer/openai-compat/responses">Responses</a></td>
</tr>
<tr>
<td><code>/v1/chat/completions</code></td>
<td><apimethod method="POST" /></td>
<td><ApiMethod method="POST" /></td>
<td><a href="/docs/developer/openai-compat/chat-completions">Chat Completions</a></td>
</tr>
<tr>
<td><code>/v1/embeddings</code></td>
<td><apimethod method="POST" /></td>
<td><ApiMethod method="POST" /></td>
<td><a href="/docs/developer/openai-compat/embeddings">Embeddings</a></td>
</tr>
<tr>
<td><code>/v1/completions</code></td>
<td><apimethod method="POST" /></td>
<td><ApiMethod method="POST" /></td>
<td><a href="/docs/developer/openai-compat/completions">Completions</a></td>
</tr>
</tbody>
</table>

<hr>
<hr />

## Set the `base url` to point to LM Studio

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
title: Anthropic Compatibility Endpoints
sidebar_title: Overview
description: Send Messages requests using the Anthropic-compatible API.
description: Send requests to Anthropic-compatible Messages endpoints.
index: 1
---

### Supported endpoints

<table class="flexible-cols">
<table className="flexible-cols">
<thead>
<tr>
<th>Endpoint</th>
Expand All @@ -18,14 +18,12 @@ index: 1
<tbody>
<tr>
<td><code>/v1/messages</code></td>
<td><apimethod method="POST" /></td>
<td><ApiMethod method="POST" /></td>
<td><a href="/docs/developer/anthropic-compat/messages">Messages</a></td>
</tr>
</tbody>
</table>
Comment thread
yagil marked this conversation as resolved.

<hr>

## Using Claude Code with LM Studio

For a full walkthrough, see: [Use Claude Code with LM Studio](/docs/integrations/claude-code).
Expand All @@ -38,11 +36,11 @@ claude --model openai/gpt-oss-20b

## Authentication headers

When Require Authentication is enabled, LM Studio accepts both `x-api-key` and the standard `Authorization: Bearer <token>` header. To learn more about enabling auth in LM Studio, checkout [Authentication](/docs/developer/core/authentication).
When Require Authentication is enabled, LM Studio accepts both `x-api-key` and the standard `Authorization: Bearer <token>` header. To learn more about enabling auth in LM Studio, see [Authentication](/docs/developer/core/authentication).

## Set the base URL to point to LM Studio

Point your Anthropic client (or any HTTP request) at your local LM Studio server.
Point your Anthropic client, or any HTTP request, at your local LM Studio server.

Note: The following examples assume the server port is `1234`.

Expand Down Expand Up @@ -87,7 +85,6 @@ message = client.messages.create(
print(message.content)
```

If you have not enabled Require Authentication, the `x-api-key` header is optional.
For the Python example, you can also omit `api_key` when authentication is disabled.
If you have not enabled Require Authentication, the `x-api-key` header is optional. For the Python example, you can also omit `api_key` when authentication is disabled.

If you're running into trouble, hop onto our [Discord](https://discord.gg/lmstudio) and enter the developers channel.
Loading