# get_openapi_chain

> **Function** in `langchain_classic`

📖 [View in docs](https://reference.langchain.com/python/langchain-classic/chains/openai_functions/openapi/get_openapi_chain)

Create a chain for querying an API from a OpenAPI spec.

!!! warning "Deprecated"
    This function and all related utilities in this module are deprecated.
    Use LLM tool calling features directly with an HTTP client instead.

## Signature

```python
get_openapi_chain(
    spec: OpenAPISpec | str,
    llm: BaseLanguageModel | None = None,
    prompt: BasePromptTemplate | None = None,
    request_chain: Chain | None = None,
    llm_chain_kwargs: dict | None = None,
    verbose: bool = False,
    headers: dict | None = None,
    params: dict | None = None,
    **kwargs: Any = {},
) -> SequentialChain
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `spec` | `OpenAPISpec \| str` | Yes | OpenAPISpec or url/file/text string corresponding to one. |
| `llm` | `BaseLanguageModel \| None` | No | language model, should be an OpenAI function-calling model, e.g. `ChatOpenAI(model="gpt-3.5-turbo-0613")`. (default: `None`) |
| `prompt` | `BasePromptTemplate \| None` | No | Main prompt template to use. (default: `None`) |
| `request_chain` | `Chain \| None` | No | Chain for taking the functions output and executing the request. (default: `None`) |
| `params` | `dict \| None` | No | Request parameters. (default: `None`) |
| `headers` | `dict \| None` | No | Request headers. (default: `None`) |
| `verbose` | `bool` | No | Whether to run the chain in verbose mode. (default: `False`) |
| `llm_chain_kwargs` | `dict \| None` | No | LLM chain additional keyword arguments. (default: `None`) |
| `**kwargs` | `Any` | No | Additional keyword arguments to pass to the chain. (default: `{}`) |

## ⚠️ Deprecated

Deprecated since version 0.2.13.

---

[View source on GitHub](https://github.com/langchain-ai/langchain/blob/b302691ff9ad841804e93e5addbdc53b6974473b/libs/langchain/langchain_classic/chains/openai_functions/openapi.py#L268)