Skip to content

Commit 0b4cb93

Browse files
committed
better formatting for third example
1 parent f2a0687 commit 0b4cb93

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/gateway.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,6 @@ You can access multiple models with the same API key, as shown in the code snipp
138138
Pass your API key directly using the provider:
139139

140140
```python {title="passing_api_key.py"}
141-
from pydantic_ai import Agent
142-
143141
from pydantic_ai import Agent
144142
from pydantic_ai.providers.gateway import gateway_provider
145143
from pydantic_ai.models.openai import OpenAIChatModel
@@ -160,13 +158,15 @@ You can access multiple models with the same API key, as shown in the code snipp
160158
If you're using a different upstream provider, you can specify it in the route parameter:
161159

162160
```python {title="routing_via_provider.py"}
163-
from pydantic_ai import Agent
164-
165161
from pydantic_ai import Agent
166162
from pydantic_ai.providers.gateway import gateway_provider
167163
from pydantic_ai.models.openai import OpenAIChatModel
168164

169-
provider = gateway_provider('openai', api_key='PYDANTIC_AI_GATEWAY_API_KEY', route='modal-ai')
165+
provider = gateway_provider(
166+
'openai',
167+
api_key='PYDANTIC_AI_GATEWAY_API_KEY',
168+
route='modal-ai'
169+
)
170170
model = OpenAIChatModel('gpt-5', provider=provider)
171171
agent = Agent(model)
172172

0 commit comments

Comments
 (0)