Get started with the OpenAI SDK in less than 5 minutes!
Python
TypeScript
1
Get your API Keys
Get your API key
Create a Linkup account for free to get your API key.
2
Installation
You can install the OpenAI SDK using the following:
pip install openai
3
Usage
Here is a basic usage showing how to use the OpenAI SDK:
from openai import OpenAIclient = OpenAI( base_url='https://api.linkup.so/v1', api_key="<YOUR API KEY>")response = client.responses.create( model="linkup-standard", input="Can you tell me which women were awarded the Physics Nobel Prize",)print(response.output_text)
1
Get your API Keys
Get your API key
Create a Linkup account for free to get your API key.
2
Installation
You can install the OpenAI SDK using the following:
npm i openai
3
Usage
Here is a basic usage showing how to use the OpenAI SDK:
import OpenAI from 'openai';const client = new OpenAI({ baseURL: 'https://api.linkup.so/v1', apiKey: "<YOUR API KEY>"});const response = await client.responses.create({ model: "linkup-standard", input: "Can you tell me which women were awarded the Physics Nobel Prize",});console.log(response.output_text);
The model field is used to select the type of search you want to perform:
"linkup-fast" (beta): the fastest mode. A single-pass, keyword-like search with no LLM involvement for query interpretation, reformulation, or evaluation. Optimized for conversational use cases where low latency is key (e.g. “weather in Paris today”)
"linkup-standard": the search will leverage agentic search for a fast yet accurate result, suited for queries that do not rely on sequential steps being performed or several pages being scraped (e.g. “What’s the weather in Paris today?”)
"linkup-deep": the search will use a full agentic workflow with up to 10 iterations to solve more complex queries (e.g. “First, find Linkup website domain. Then scrape the homepage, product page, and about us page. Then search for recent news. Consolidate the output in a comprehensive company profile”). Runs longer than the other depths.
Create a Linkup account for free to get your API key.
2
Installation
You need to install the OpenAI SDK and Pydantic using the following:
pip install openai pydantic
3
Usage
Here is a example of how to use the structured output with the OpenAI SDK:
from openai import OpenAIfrom pydantic import BaseModelclass Winner(BaseModel): name: str year: strclass Response(BaseModel): winners: list[Winner]client = OpenAI( base_url='https://api.linkup.so/v1', api_key="<YOUR API KEY>")response = client.responses.parse( model="linkup-standard", input="Can you tell me which women were awarded the Physics Nobel Prize", text_format=Response,)print(response.output_parsed)
1
Get your API Keys
Get your API key
Create a Linkup account for free to get your API key.
2
Installation
You need to install the OpenAI SDK and Zod using the following:
npm i openai zod
3
Usage
Here is a example of how to use the structured output with the OpenAI SDK:
import OpenAI from 'openai';import { zodTextFormat } from 'openai/helpers/zod.mjs';import { z } from "zod";const client = new OpenAI({ baseURL: 'https://api.linkup.so/v1', apiKey: "<YOUR API KEY>"});const NobelWinners = z.object({ winners: z.array( z.object({ name: z.string(), year: z.string(), }) )});const response = await client.responses.create({ model: "linkup-standard", input: "Can you tell me which women were awarded the Physics Nobel Prize", text: { format: zodTextFormat(NobelWinners, "winners"), }});console.log(response.output_text);
Need help? Email support@linkup.so, ping us on Discord, or talk to us.