API Architecture
The NeoSpace AI API is designed to be robust, scalable, and easy to use. This section provides an overview of our API architecture to help you understand how it works and how to best integrate it into your systems.
Design principles
Our API was built following these fundamental principles:
- RESTful: Consistent interfaces that use standard HTTP methods
- Resource-oriented: Endpoints organized around financial resources
- Versioned: Controlled evolution with backward compatibility
- Secure: Robust authentication and encryption in all communications
- Observable: Detailed logs and telemetry for diagnostics
API Structure
Base endpoints
NeoSpace AI offers two distinct environments, each with its own base endpoint:
- Production:
https://api.neospace.ai - Sandbox:
https://sandbox-api.neospace.ai
Versioning
All APIs are versioned to ensure compatibility. The current version is v1 and is included in the URL path:
https://api.neospace.ai/v1/resource
When we release new versions of the API, we keep previous versions working for at least 12 months to allow gradual migrations.
Data model
Our API uses a consistent data model across all products:
graph TD
A[Client] -->|has| B[API Keys]
A -->|has| C[Projects]
C -->|contains| D[Experts]
C -->|contains| E[Chats]
E -->|has| F[Messages]
D -->|defines| G[Tools]
D -->|has| H[Context]
Main objects
| Object | Description | Endpoint |
|---|---|---|
| Client | Represents an organization or user of the platform | /v1/customers |
| Project | Groups related resources for a specific use case | /v1/projects |
| Expert | AI specialist configured for a specific task | /v1/experts |
| Chat | Conversation between user and AI model | /v1/chats |
Data flow
The following diagram illustrates the typical data flow through the NeoSpace AI API:
sequenceDiagram
participant Client
participant API
participant Authentication
participant Models
participant Storage
Client->>API: Request with API Key
API->>Authentication: Validate credentials
Authentication-->>API: Valid credentials
API->>Models: Process request
Models-->>API: Model response
API->>Storage: Record interaction
API-->>Client: Formatted response
Architecture components
API Gateway
Our API gateway manages all requests, handling:
- Traffic routing
- Rate limiting
- Authentication and authorization
- Logging and monitoring
AI Services
Specialized services that process different types of requests:
- NeoLang Service: Financial natural language processing
- NeoCredit Service: Credit and risk analysis
- NeoCustomer Service: Customer analysis and segmentation
Data storage
We use a combination of storage technologies:
- MongoDB: For structured and semi-structured data
- Redis: For cache and temporary data
- S3: For document and large file storage
Observability systems
We continuously monitor the performance and health of the API through:
- Logs: Detailed recording of all operations
- Metrics: Measurement of performance and usage
- Traces: Tracking of requests through components
- Alerts: Automatic notifications about issues
Integration considerations
High availability
Our API is designed for high availability with:
- Multi-region deployment
- Automatic load balancing
- Automatic failure recovery
Latency
To minimize latency:
- Use the endpoint closest to your region
- Implement caching when appropriate
- Consider batch processing for multiple operations
Scalability
Our architecture automatically scales to handle varying loads:
- Demand-based auto-scaling
- Adjustable rate limits for enterprise clients
- Continuous resource optimization
Infrastructure security
NeoSpace AI implements multiple layers of security:
- In-transit encryption: TLS 1.3 for all communications
- At-rest encryption: All stored data is encrypted
- Network isolation: Strict segmentation between environments
- Security monitoring: Real-time threat detection