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

# Addresses, keys, and models

> Connect to the correct deployment and confirm model capabilities.

## Configure the connection

Complete the [quickstart](/en/quickstart.md) to obtain a model API key and service address. These guides use three environment variables:

```bash theme={null}
export API_BASE_URL='https://gateway.example.com/v1'
export API_KEY='YOUR_API_KEY'
export API_MODEL='YOUR_MODEL_ID'
```

Replace all three placeholders. `API_BASE_URL` includes one `/v1`, with no trailing slash. Preserve any deployment path prefix. Use the HTTPS address supplied by your administrator for production requests.

| Client | Example value |
| - | - |
| OpenAI Python SDK `base_url` | `https://gateway.example.com/v1` |
| OpenAI TypeScript SDK `baseURL` | `https://gateway.example.com/v1` |
| HTTP Chat Completions URL | `https://gateway.example.com/v1/chat/completions` |

Some third-party clients add `/v1` automatically. Check their URL convention. For HTML responses or 404 errors, first check the hostname, path prefix, and duplicate `/v1` segments.

## Authenticate requests

Send `Authorization: Bearer YOUR_API_KEY`. Read the key from environment variables or a server-side secret manager. Console cookies and management credentials are not model API keys. Keep keys out of browser bundles; route browser interactions through your own server.

## Choose a model and endpoint

[List models](/en/api-reference/models.md) and use the exact `data[].id`. Visibility depends on account access, key permissions, groups, and deployment configuration. Listing a model does not guarantee support for every protocol.

* Use [Chat Completions](/en/api-reference/chat-completions.md) for ordinary conversations, passing message history with each request.
* Use [Responses](/en/api-reference/responses.md) when supported by your model. Changing only the URL is insufficient: request and response shapes differ.
* Confirm image, audio, tool calling, structured output, reasoning, and streaming support separately for the model and channel.

Start with a minimal text request and add optional parameters one at a time. Do not copy another provider's model IDs or default parameters without checking support.

## Move an existing client

Keep application prompts unchanged at first. Replace the service address, API key, and model ID, then compare successful responses, error handling, and timeout behavior. Check files, batches, background tasks, response retrieval, and other platform features separately before relying on them through a compatible gateway.

## Build an application

[Multi-turn conversations](/en/guides/conversations.md) · [Tool calling](/en/guides/tool-calling.md) · [Structured output](/en/guides/structured-output.md) · [Image understanding](/en/guides/vision.md)

[简体中文](/zh/guides/api-basics.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.